Skip to main content

Install the Kong Gateway Example Application

Be sure kubectl is configured to point to the cluster you want to use for the Kong Gateway example application.

info

Follow the Kong Gateway system Quick Start instructions to install the Kong Gateway through Helm method.

To install Styra on Kong Gateway, you must copy and paste all the installation commands from SYSTEMS >> Settings >> Install. These commands will install the custom Kong plugin for OPA, configures Kong plugin for OPA authorization, and configures OPA to connect to DAS through the Styra Local Plane (SLP).

The Kong Gateway Quick Start provides the link to install example application. It consists of the following components which should now be running in your minikube. All resources are suffixed by the SYSTEM ID to mark them as unique.

  • example-app: A simple HTTP web server that allows employees of a hypothetical organization to obtain salary details at the path /finance/salary. It also exposes a path /hr/dashboard that is only accessible by employees who are part of HR. Functionally, it is a simple echo server that returns a HTTP 200 response with a plain or text body which contains a success or error message.

  • sample-ingress: An ingress resource which exposes HTTP route from outside the cluster to example-app service within the cluster. The Kong plugin for OPA is enabled by annotating the ingress resource with konghq.com/plugins: kong-plugin-opa.

  • slp: Styra Local Plane (SLP) is a service that acts as an intermediary between the OPAs and Styra DAS. OPAs are configured to retrieve bundles from SLP rather than directly from DAS. This increases availability as SLP fetches bundles from Styra DAS and persists them to disk, so policies are still available to new or restarted OPAs even if Styra DAS is unavailable.

When you run the Kong Gateway example application, the OPA sidecars will pull down the policy from DAS tenant and start enforcing it. This process takes few minutes to complete.

Figure 1 - Kong Gateway Example ApplicationFigure 1 - Kong Gateway Example Application