I had a university customer in the Northwest ask me about how to get quickly started with the new Kubernetes on Azure Container Services (ACS).
I had not played with it so I put together a quick walkthrough of how to get Kubernetes going via Azure Container Services and how it can be paired with Helm.
What is Kubernetes with Azure Container Service?
Kubernetes is an open source container cluster manager used to deploy, scale and operate applications across a number of host computers. It has been recently added to Azure Container Service in addition to two other container orchestrators Mesosphere DC/OS and Docker Swarm.
What do I get when I deploy it from ACS?
When you deploy Kubernetes from ACS it will automatically create one master VM and two or three node VMs. ACS will also automatically configure VNet, a load balancer, NAT, etc. It will also autoscale your hosts as you grow your container footprint so ACS has a nice advantage over installing Kubernetes without ACS in VMs which would take quite a bit longer get this running.
ACS with Kubernetes Prerequisites
Bash or equivalent (I used Bash on Windows 10 see here)
Azure CLI 2.0 – install from here
Login into Azure via Bash:
az login
Set the right subscription context if needed (optional):
az account set –subscription “ab12c34d-56a7-9876-b4ba-a0b1cd3f1234”
az account show
Next you want to create the Kubernetes Cluster:
From Bash I ran (may need to tweak for Command Prompt Azure CLI):
DNS_PREFIX=kub07
CLUSTER_NAME=kubclus07
RESOURCE_GROUP=kub-rg-07 (I pre-created this resource group)
az acs create –orchestrator-type=kubernetes –resource-group $RESOURCE_GROUP –name=$CLUSTER_NAME –dns-prefix=$DNS_PREFIX –generate-ssh-keys
It will take a bit but if it worked you will see a status of succeeded:
If all went well, in Azure portal you will see the Kubernetes cluster master and three nodes deployed as virtual machines. You can change the VM HW profiles if you need more CPU/RAM, etc.
Next you need to install the Kubernetes CLI to manage the cluster:
az acs kubernetes install-cli
Grab the Kubernetes cluster config locally:
az acs kubernetes get-credentials –resource-group=$RESOURCE_GROUP –name=$CLUSTER_NAME
Run kubectl get nodes to see the cluster nodes and master:
I installed NGIX from CLI to see if it worked:
kubectl run nginx –image nginx
Browse to the External IP and it should show the Nginx start page:
I also wanted to check out what Deis provided with Kubernetes since we just acquired them. They have a product called Helm. I installed Helm in the cluster. It deploys a server within the cluster:
curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get > get_helm.sh
chmod 700 get_helm.sh $ ./get_helm.sh
Next I went to KubeApps website which is like a registry for Helm charts (application packages) you can deploy to Kubernetes using Helm here:
I decided to install DokuWiki:
You grab the helm command line to install:
helm install stable/dokuwiki
I ran kubectl get svc to get the External IP to browse to and then browsed to make sure dokuwiki deployed:
Next I installed WordPress:
helm install stable/wordpress
I ran kubectl get svc to list the external IPs:
Wait a few minutes for the external IP to show up.
Browse to the external IP to test WordPress:
I can see the power of the combination of Kubernetes and Helm together as it makes beginners like me with Kubernetes able to quickly get popular applications running in Kubernetes without much effort.
If you want to manage Kubernetes from the browser
Run: kubectl proxy
Hit this URL to see the Kubernetes interface:
Here you can see all the apps I deployed to the Kubernetes cluster:
Good Kubernetes user guide here.
Enjoy setting up and using Kubernetes containers in Azure Container Services!