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

  1. Initial setup

    Download or clone the following repo:

    $ git clone [email protected]:Mashape/kong-dist-kubernetes.git
    $ cd kong-dist-kubernetes
    

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

  2. 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 at least two STATIC_ADDRESSES available.

    Using the cluster.yaml file from the kong-dist-kubernetes repo, deploy a GKE cluster. Provide the following information before deploying:

    1. Desired cluster name
    2. Zone in which to run the cluster
    3. 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.

  3. Deploy a Kong supported database

    Before deploying Kong, you need to provision a Cassandra or PostgreSQL pod.

    For Cassandra, use the cassandra.yaml file from the kong-dist-kubernetes repo to deploy a Cassandra Service and a ReplicationController in the cluster:

    $ kubectl create -f cassandra.yaml
    

    For PostgreSQL, use the postgres.yaml file from the kong-dist-kubernetes repo to deploy a PostgreSQL Service and a ReplicationController in the cluster:

    $ kubectl create -f postgres.yaml
    
  4. Deploy Kong

    Using the kong_<postgres|cassandra>.yaml file from the kong-dist-kubernetes repo, deploy a Kong Service and a Deployment to the cluster created in the last step:

    $ kubectl create -f kong_<postgres|cassandra>.yaml.yaml
    
  5. Verify your deployments

    You can now 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 by making the following requests:

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

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


Having Trouble? We're Here to Help!

Keep up with the latest features