Following my earlier discussion of enterprise orchestration, I decided to look closer at hosted Kubernetes clusters from Google Cloud, Microsoft Azure, and AWS Cloud. To start with, I’ll be trying out the free trial of Google Container Engine.
export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)" echo "deb https://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - sudo apt-get update && sudo apt-get install google-cloud-sdk kubectl gcloud init
I then setup API credentials for my
gcloud CLI. First I created a credential, then downloaded the key as JSON:
sudo gcloud auth activate-service-account --key-file MyProject-1234325.json
Then in Google Cloud Console, I created the new Kubernetes cluster:
After creation, the console showed the newly running Kubernetes cluster (3 nodes):
I then connected from my local kubectl util:
gcloud container clusters get-credentials mykube --zone us-central1-a --project <project-id> kubectl proxy
This opened a local proxy to my Kubernetes cluster’s Admin Dashboard:
Which I then scaled from one to three pods with:
kubectl scale --replicas=3 deployment/nginx-test
Since, I’d set the
nginx-test deployment to be available as an external service on the Kubernetes clsuter, I could view it in a browser from my workstation:
For more useful Kubernetes commands, see the
The monitoring dashboard allows one to see CPU, memory, and disk usage (example below):
Stackdriver is free for GCP VM monitoring and email alerts. A premium tier offers combined monitoring of AWS instances as well, plus notifications in Slack, PagerDuty and more.
After evaluating various container orchestrators and cloud providers, I’m now convinced that:
Software development best practice is now containerized deployments on an industry-standard orchestator, run by your preferred cloud platform.