Setup:

  • If you don

    t already have a Google Account (Gmail or Google Apps), you must create one. Then, sign-in to Google Cloud Platform console ( cloud.google.com) and create a new project.

  • Subscribe free tier for 12 months.Next, enable billing in the Cloud Console in order to use Google Cloud resources and enable the Container Engine API.

  • Install Docker, and Google Cloud SDK.

  • Finally, after Google Cloud SDK installs, run the following command to install kubectl: gcloud components install kubectl

  • Choose a Google Cloud Project zone to run your service. We will be using us-central1. This is configured on the command line via:

              gcloud config set compute/zone us-central1
    

Deployment:

  • First create a cluster

              gcloud container clusters create clusterName
    
  • In gcloud shell run the following command to deploy application using given configurations.

              bash ./kubernetes/deploy.sh create
    
  • This will create the deployment according to yaml files defined.

  • The Kubernetes master creates the load balancer and related Compute Engine forwarding rules, target pools, and firewall rules to make the service fully accessible from outside of Google Cloud Platform.

  • Wait for a few minutes for all the containers to be created.

Tracking:

Cleanup:

  • If you want to delete the deployment from the cluster enter this command:

              bash ./kubernetes/deploy.sh delete
    
  • To delete cluster enter:

              gcloud container clusters delete clusterName