Get Started with Kubernetes (AKS) in AzureSolution ·
A few weeks ago we wrote an article about how to get started with Docker in Azure.
This time we’ll do it with Kubernetes using Azure AKS Service.
What is Kubernetes?
Kubernetes is an open-source system for automating deployment, scaling, and management of containerized applications.
In the online documentation overview, Kubernetes is further defined as:
- a container platform
- a micro-services platform
- a portable cloud platform
Kubernetes was inspired by Google’s Borg project. Google uses Borg to run very large clusters (10 000 machines).
There are a lot of Kubernetes tutorials. We suggest two here:
- Kubernetes Interactive Tutorial: online tutorial giving access to a Kubernetes cluster via a web interface. Zero install required. Learn from the source (i.e. https://kubernetes.io/)
- Introduction to Kubernetes from Linux Foundation X (LFS158x) by EDX: like many EDX courses, it is free unless we want a certificate. It covers Kubernetes at large. It is text-based (i.e. not much videos).
We suggest getting our hands dirty using Azure AKS right away as opposed to installing Minikube on our laptop.
What is Azure AKS?
AKS is a managed service running Kubernetes Clusters (as we’ve seen in our Overview of containers in Azure).
It is managed in the sense the service manages (e.g. patches) the worker nodes VMs. Head nodes aren’t charged.
AKS is the next generation of ACS. ACS was an unmanaged service where both head and worker VMs were the responsibility of the user.
AKS has a very low friction starting scenario using the Azure CLI. A similar scenario exists using the Azure Portal. We recommend trying the CLI one as the Portal’s support is still limited (as of this writing, mid-April 2018).
The creation of a cluster is one simple command:
az aks create –resource-group myResourceGroup –name myAKSCluster –node-count 1 –generate-ssh-keys
az aks install-cli
az aks get-credentials –resource-group myResourceGroup –name myAKSCluster
The first command creates the cluster (in a pre-existing resource group). The second installs Kubernetes CLI. The third one downloads the cluster’s credentials for Kubernetes CLI to use.
The online documentation goes through those steps and more. We create two deployments and two services and test them.
It is quite easy and convenient to do this demo on our laptop. Same thing for any training (e.g. those suggested in the previous section) . It requires a Linux environment. We use Windows Subsystem for Linux (aka bash shell). If for some reason that isn’t possible, we can always provision a VM in Azure with Azure CLI.
Only the Kubernetes CLI gets installed on the client machine. Kubernetes itself and all running containers are in AKS. The client machine doesn’t get contaminated.
The online documentation is quite good at this point (mid-April 2018). We can learn many of the basics of AKS:
- Using Kubernetes Dashboard
- SSH to nodes
- Scaling (i.e. increase / decrease the number of nodes) a cluster with the CLI
- Upgrading (i.e. upgrade to a newer version of Kubernetes) the cluster with no downtime. This is meant for production use. It therefore prioritizes availability over speed. One CLI command orchestrates the upgrade of an entire cluster. This shows the advantage of managed services.
- Configuring Kubernetes volumes using Azure Disks & Files. We can also use Kubernetes Persistent volumes for better separation of dev & ops.
- Configuring Network Ingress
- Integrating with Azure Container Registry
- Using Helm
- Using Draft
- Using Open Service Broker for Azure (OSBA) to integrate Azure PaaS services (e.g. Azure SQL) into Kubernetes deployment
- Using Jenkins for Continuous deployment
- Using OpenFaaS (a Function as a Service Open Source framework)
- Running Spark jobs on AKS
- Using GPUs
Finally the FAQ is a good place to go about incoming features and current limitations.
Azure AKS is a strong addition to the Container family in Azure. It is growing quite quickly although it isn’t Generally Available (GA) as of this writing (mid April 2018) yet.
The friction free setup and general management of the cluster makes it very quick & easy to start.
Given the popularity of Kubernetes, this service is a must to get familiar with.