Kong can easily be provisioned to Kubernetes cluster using the following steps:
Download or clone the following repo:
$ git clone [email protected]:Mashape/kong-dist-kubernetes.git $ cd kong-dist-kubernetes
If you want to run Kubernetes locally, please follow the README and use the manifest files provided in
Skip to step 3 if you have already provisioned a cluster and registered it with Kubernetes.
Note: Included manifest files in repo only support Kong v0.11.x, for 0.10.x please use the tag 1.0.0.
Deploy a GKE cluster
You need gcloud and kubectl command-line tools installed and set up to run deployment commands. Also make sure your Google Cloud account has
STATIC_ADDRESSESavailable for the external access of Kong services.
cluster.yamlfile from this repo, deploy a GKE cluster. Provide the following information before deploying:
- Desired cluster name
- Zone in which to run the cluster
- A basicauth username and password for authenticating the access to the cluster
$ gcloud deployment-manager deployments \ create cluster --config cluster.yaml
By now, you have provisioned a Kubernetes managed cluster.
Deploy a Kong supported database
Before deploying Kong, you need to provision a Cassandra or PostgreSQL pod.
For Cassandra, use the
cassandra.yamlfile from this repo to deploy a Cassandra
StatefulSetin the cluster:
$ kubectl create -f cassandra.yaml
Note: Please update the
cassandra.yamlfile for the cloud you are working with.
For PostgreSQL, use the
postgres.yamlfile from the kong-dist-kubernetes repo to deploy a PostgreSQL
ReplicationControllerin the cluster:
$ kubectl create -f postgres.yaml
kong_migration_<postgres|cassandra>.yamlfile from this repo, run the migration job, jump to step 5 if Kong migrations are up–to–date:
$ kubectl create -f kong_migration_<postgres|cassandra>.yaml
Once job completes, you can remove the pod by running following command:
$ kubectl delete -f kong_migration_<postgres|cassandra>.yaml
kong_<postgres|cassandra>.yamlfile from this repo, deploy Kong admin, proxy services, and a
Deploymentcontroller to the cluster:
$ kubectl create -f kong_<postgres|cassandra>.yaml
Verify your deployments
You can now see the resources that have been deployed using
$ kubectl get all
EXTERNAL_IPis available for Kong Proxy and Admin services, you can test Kong by making the following requests:
$ curl <kong-admin-ip-address>:8001 $ curl https://<admin-ssl-ip-address>:8444 $ curl <kong-proxy-ip-address>:8000 $ curl https://<kong-proxy-ssl-ip-address>:8443
Quickly learn how to use Kong with the 5-minute Quickstart.
Get future release notes emailed to you.