Kubernetes setup process

The following guide takes you through how to deploy an instance of Restful-booker-platform onto Kubernetes and tie it to a subdomain of automationintesting.online.

The following tools are required:

  • Google account
  • Access to the restful-booker-platform gcloud project
  • Google-cloud-sdk (with the kubectl plugin)
  • Docker
  • Access to automationintesting.online on Cloudflare

Create the cluster

Firstly, we require a cluster to deploy rbp into

  1. With your Google account log into the Google Cloud console. Quick link here.
  2. From the left hand panel head to Kubernetes Engine > Clusters.
  3. Select ‘Create clusters’
  4. Set the following credentials
    • Name: rbp-team1 (or similar)
    • Zone: europe-north1-a
    • Number of nodes: 7
    • Machine type: small

Setup local access to your cluster

The cluster will take a few minutes to setup, but once it’s created it we will need to pull down the cluster details to our local machine so we can deploy RBP

  1. Open up a terminal window
  2. Run the following, replacing CLUSTER_NAME with the name of the cluster you created in the previous step: gcloud container clusters get-credentials CLUSTER_NAME --region europe-north1-a
  3. Startup Docker
  4. Once Docker is loaded, select your cluster from the Docker Icon on Menu > Kubernetes
  5. Test that you have accessed the correct cluster by running the following in the terminal: kubectl get pods You should get no results

Deploy RBP to the cluster

Now we have local access to the cluster, we can deploy RBP into it

  1. Pull down the latest instance of the RBP Git repo
  2. Navigate in the terminal to the .kubes/class folder
  3. Run the following, replacing the team number with the team number you are deploying: kubectl create -f teamX-deploy.yml
  4. Head back to the gcloud console and head to Network Services > Load balancing and wait for the new load balancer to appear

Set DNS settings to give public access to the RBP instance

  1. Once the load balancer has been created, click on it to open the load balancer details
  2. Copy the IP address at the top under ‘Frontend’ (Port not required)
  3. Select ‘Cloud DNS’ on the left hand side
  4. Select ‘rbp-zone’ from the DNS list
  5. Based on the team you are creating add or update the following record set:
    • DNS name: teamX.automationintesting.online
    • Resource record type: A
    • IPv4 address:
  6. With the DNS set, head over to the automationintesting.online profile on Cloudflare
  7. Select DNS
  8. Create the same record set as you did in Cloud DNS in Cloudflare with the following details
    • Type: A
    • Name: teamX
    • IPv4 address:
    • TTL: Automatic
    • Enable DNS and HTTP proxy