Install Konga on K8S

Even though when running Kong API Gateway in K8S, It's recommended to use the yaml descriptive files to create the routes and services for your applications, you can use the Kong Admin API [3] and the Konga web interface [2] for those tasks. This tutorial shows you how to install Konga on your K8S cluster using helm (I based on [1] and added support for pod annotations). All source code and the helm chart used in this tutorial are at [0].

Prerequisites:

- You have the master role in your K8S cluster to install new applications, create ingresses, etc.

- Kong API Gateway (Kong Ingress Controller) has been installed on your K8S cluster and in the kong namespace

- You have full privileges to create a new Postgres database for your Konga

Install Konga on K8S:

1. Create the Postgres DB for your Konga

CREATE USER konga;
CREATE DATABASE konga OWNER konga;
ALTER USER konga WITH PASSWORD <your secret>;

2. Prepare the values.yaml file

Update the values.yaml with these following information

config: {}
  port1337
  node_env<development or production>
  db_adapterpostgres
  db_host<address of your postgres db host>
  db_port5432
  db_userkonga
  db_password<postgres password>
  db_databasekonga

and

runMigrationstrue

3. Install Konga helm chart

helm install konga ./ -n kong -f values.yaml

4. Expose Konga using ingress 

Prepare the ingress.yaml file as following

apiVersionnetworking.k8s.io/v1
kindIngress
metadata:
  namekonga-ingress
  namespacekong
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target/
spec:
  rules:
  - hostkonga.yourdomain.com
    http:
      paths:
      - path"/"
        pathTypePrefix
        backend:
          service:
            namekonga
            port:
              number80

Run kubectl to create the ingress

kubectl apply -f ingress.yaml

Now you can access Konga at konga.yourdomain.com.

References:

[0] https://github.com/dangtrinhnt/konga-helm-chart

[1] https://github.com/bennu/charts/tree/main/charts/konga

[2] https://github.com/pantsel/konga

[3] https://docs.konghq.com/gateway-oss/2.4.x/admin-api/

Comments