Introduction
Today, I’m excited to share a detailed guide on setting up Kong Gateway in hybrid mode using Helm charts. This setup provides a base where you can start playing around the Kong Hybrid setup and build and expand your own setup on top of this. We’ll be using my GitHub repository which contains all the necessary configurations and scripts.
Prerequisites
Before we dive in, ensure you have:
- A Kubernetes cluster (Minikube, GKE, EKS, or AKS).
- For now you can start with
minikube
- For now you can start with
- Helm installed
kubectl
configured- A valid Kong Enterprise license
Getting Started
First, clone the repository:
git clone https://github.com/bhatikuldeep/kong-hybrid-helm.git
cd kong-hybrid-helm
Add your Kong Enterprise license file as license.json
in the root directory.
Version Management
One of the great features of this setup is the ability to easily switch between Kong versions. This is managed through the .env
file:
- Open the
.env
file - Find the
IMAGE_TAG
variable - Update to your desired version:
IMAGE_TAG=3.8.0.0
This flexibility allows you to test different Kong versions or stick to a specific version for your deployment.
Installation
Running the installation is straightforward:
chmod +x install-kong.sh
./install-kong.sh
This script handles:
- Creating the necessary Kubernetes namespace
- Setting up secrets for the license and TLS certificates
- Deploying Kong using Helm
Validate Setup
Accessing Kong Manager
Once installed, access Kong Manager at http://127.0.0.1:8002
using:
- Username: kong_admin
- Password: password
Configuration Sync
Before verifying proxy endpoint, lets sync deck configuration provided in the repo:
deck gateway sync --headers 'kong-admin-token:password' decks/kong.yaml
Verifying the Proxy
Test this setup with:
http :8000/anything
HTTP/1.1 200 OK
...
{
"args": {},
"data": "",
"files": {},
"form": {},
"headers": {
"Accept": "*/*",
"Accept-Encoding": "gzip, deflate",
"Host": "httpbin.org",
"User-Agent": "HTTPie/3.2.3",
"X-Amzn-Trace-Id": "Root=1-66ff220f-53a7e1af1633aeba702e8866",
"X-Forwarded-Host": "localhost",
"X-Forwarded-Path": "/anything",
"X-Forwarded-Prefix": "/anything",
"X-Kong-Request-Id": "f4a434028ed8a12e1d88c81bb0b31611"
},
"json": null,
"method": "GET",
"origin": "192.168.194.1",
"url": "http://localhost/anything"
}
You should receive a 200 OK response, confirming our Kong gateway installation is working correctly.
Resources
Feel free to contribute to the repository or reach out if you have questions!