Kong for kubernetes and backend applications integration clarification

This could be very basic question but please answer as I am new to kong.
I went through the kong for kubernetes documentation and basic lab trainings where there is no clear explanation given on whether kong will be deployed on the same k8s cluster where backend applications like microservices are deployed or kong will be deployed on completely new k8s cluster where only kong is deployed and no backend application is running.

Also, is there any labs or documentation which clearly explains about all the steps required to setup distributed and hybrid installation model on/for k8s.

Hi there, you can deploy Kong the same cluster with its own namespace (Kong)

Thanks. Does it mean that application services are already there and in the same way we need to deploy kong?
If yes then kong is tightly coupled with applications deployed on the same k8s. When application server goes down, kong also goes down. And more importantly how to differentiate CP and DP deployment

You will generally run Kong on the same cluster as your backend applications. You can point the controller to services running elsewhere using ExternalName Services, but that should only be used if there’s something that cannot run in the same cluster as the Kong instance.

charts/charts/kong at main · Kong/charts · GitHub covers the configuration needed to set up hybrid mode.

Thanks @traines and @Kuberzepam for your response.

So to setup Kong for k8s (db-less or db-backed), it is prerequisite that k8s cluster is already setup with necessary master and worker nodes.
And as per k8s feature, worker nodes serve the traffic and master node manages worker nodes, pods, etc.

Assume my k8s architecture contains 3 master and 3 worker nodes and my microservice applications are running on this architecture.
Now I want to add kong gateway in this architecture. My understanding is,

  • Install kong on all 3 worker nodes.
  • One node will act as CP so we do CP related configuration in one node say on node-1. Rest two nodes will act as DP nodes and configured accordingly
  • No need to make any changes in 3 master nodes or no kong related deployments will be done on 3 master nodes

Please correct if my understanding is right

deploy kong using helm per your requirement in values.yml file and it will deploy 3 pods for you in your k8s cluster (worker nodes off course). you don’t manually install into 3 worker nodes. k8s scheduler will manage that for you

you mean, I can deploy kong in one node say node-1 and k8s scheduler will automatically install kong in remaining 2 worker nodes ?
If this is correct, then it will install kong as CP in all 3 worker nodes.

Let me rephrase my question,
Considering my k8s architecture (3-master and 3 worker nodes), where I can install kong as CP and DP ? I mean on which nodes kong CP should be installed and on which nodes kong DP will be configured ?

Kong won’t deploy to the Kubernetes master nodes at all, only workers.

You should generally have a reason you know you need hybrid mode (e.g. you want to isolate CP nodes and the database in a different network segment than the DP nodes)–by default I’d just recommend the non-hybrid modes, as they’re less complex.

In general, there isn’t strict guidance on how many Kong instances you deploy or where you deploy them. You’ll need to decide that based on what you can determine from load testing, your expected traffic characteristics, and your cluster network topography.

We provide the means to run on all workers as a DaemonSet or deploy based on affinity/toleration/etc. rules.

1 Like

Thank you for your response


© 2019 Kong Inc.    Terms  •  Privacy  •  FAQ