Rancher with Kong and Konga
I have to use kong in on premise rancher without external load balance support(No Ingress). I’m not sure if it a good practice. But this is a note if I can’t come up with a better one. :D
Todo List
- Create Persistent Volume (PV) for kong database (postgres).
- Launch Kong.
- Deploy Konga.
- Add reverse proxy for Kong and Konga.
- Login to Konga and add Kong Connection.
- Test Kong By Deploy nginx then adding Service and Route from Konga.
Let’s start with create PV. In Worknode machine, Create Folder /apps/kong and chmod 777 on this folder
From Top Menu in Cluster, Select Storage >Persistent Volume. Then Add Volume button
You will get your new PV Available in the list.
I use Bitnami’s Kong so I need to add Bitnami Catalog.
Add catalog as the picture above. Catalog URL for bitnami is
https://charts.bitnami.com/bitnami
Next, Launch Kong from Catalog.
Create New Namespace if you want. Add some config as follow then click Launch.
service.type=NodePort
service.exposeAdmin=true
service.proxyHttpNodePort=32080
service.proxyHttpsNodePort=32443
service.adminHttpNodePort=32444
service.adminHttpsNodePort=30444
ingressController.installCRDs=false
ingressController.enabled=false
postgresql.enabled=true
postgresql.postgresqlPassword=password
Check App. You will see, There are 4 ports exposed as NodePort.
Next click deploy to deploy Konga.
Select the same Namespace as Kong’s Namespace. Use NodePort to route it out.
Next, we will set up nginx reverse proxy by access machine with public ip in the same network. This machine must have docker install.
Create file /apps/nginx/nginx.conf as follow
Server name is your public ip or url of your server. proxy_pass is internal ip of your worknode machine.
Run docker command as follow. Allow your firewall for port 8081, 8082.
Open your browser with your public ip:8082 (for me, It’s http://203.159.70.100:8082)
If you see this message, your kong api gateway is expose to the wotld.
Open your browser with your public ip:8081 (for me, It’s http://203.159.70.100:8081).
Create admin user and login.
Config Kong Admin URL to http://10.255.0.146:32444 (http://your_worknode_internal_ip:your_kong_admin_nodeport)
Or you can use http://kong:8001
You can check connection by menu connection. Your connection will have a green connected icon with the Deactivate button in green.
Then deploy nginx to test kong. Go to Workloads page in Rancher the click deploy.
Then Add New Service in Konga. Open your konga page, click menu service to create new service.
Fill in Name, Protocol, Host, Port of your nginx-api test module.
You can also use worknode ip and Nodeport instead of workload name and containner port. (Host: 10.255.0.146 and Port: 30005 is worked also.)
Then click on your newly added service. Click Route to add new route.
Fill in Name and Path your want Kong to route to your api.
Open your browser and test your Kong. your public ip:8082/route_path (for me, It’s http://203.159.70.100:8082/nginx-api)
If you can see nginx default page, you’re done.