Kubernetes managed Kong cluster
HTML

README.md

KONG Kubernetes Deployment

Website Documentation Mailing List Gitter Badge

Kong can easily be provisioned to Kubernetes cluster using the following steps:

  1. Initial setup:

    Skip to step 2 if you already provisioned a cluster and registered it with Kubernetes.

    Deploy a GKE cluster

    You would need gcloud and kubectl command-line tools installed and set up to run deployment commands. Also make sure your Google Cloud account has at least two STATIC_ADDRESSES available.

    Download or clone the repo

    $ git clone git@github.com:Mashape/kong-dist-kubernetes.git
    $ cd kong-dist-google-cloud

    Using cluster.yaml, deploy a GKE cluster to use for deploying the solution later. Fill in the following information before deploying:

    • desired cluster name
    • zone in which to run the cluster
    • basicauth username and password for authenticating access to the cluster

    When ready, deploy with the following command:

    $ gcloud deployment-manager deployments create cluster --config cluster.yaml
  2. Deploy a Kong supported Database

    Cassandra

    Using cassandra.yaml deploy a Cassandra Service and a ReplicationController to the cluster created in the last step.

    When ready, deploy with the following command:

    $ kubectl create -f cassandra.yaml

    Postgres

    Using postgres.yaml deploy a Postges Service and a ReplicationController to the cluster created in the last step.

    When ready, deploy with the following command:

    $ kubectl create -f postgres.yaml
  3. Deploying Kong on the cluster

    Using kong.yaml, deploy a Kong Service and a Deployment to the cluster created in the last step. Update the environment variable KONG_DNS_RESOLVER with the IP of the DNS resolver you want use or Kubernetes kube-dns IP. Use following command to get the kube-dns IP

    $ kubectl get svc kube-dns --namespace=kube-system | grep kube-dns | awk '{print $2}'

    When ready, deploy with the following command:

    $ kubectl create -f kong.yaml
  4. Verifying deployment

    Now you can see the resources that have been deployed using kubectl:

    $ kubectl get rc
    $ kubectl get deployment
    $ kubectl get pods
    $ kubectl get services
    $ kubectl get logs <pod-name>

    Once the EXTERNAL_IP is available for Kong Proxy and Admin services, you can test Kong:

    $ curl <admin-ip-address>:8001
    $ curl <proxy-ip-address>:8000
  5. Using Kong:

    Quickly learn how to use Kong with the 5-minute Quickstart.

Important Note

When deploying into a Kubernetes cluster with Deployment Manager, it is important to be aware that deleting ReplicationController Kubernetes objects does not delete its underlying pods, and it is your responisibility to manage the destruction of these resources when deleting or updating a ReplicationController in your configuration.

Enterprise Support

Support, Demo, Training, API Certifications and Consulting available at http://getkong.org/enterprise.