Kubernetes in action
In the first few sections of this chapter, we created a container and deployed it to an Azure container instance. Let’s now deploy this container to a Kubernetes cluster.
Creating a cluster can be done via the Azure CLI or an Azure Resource Manager (ARM) template. For ease of demonstration, the Azure CLI will be used.
First, a new resource group needs to be created to host the Azure Kubernetes cluster:
az group create --name mpn-rg-kubernetes --location westeurope
Now, we can create our Kubernetes cluster.
Creating a Kubernetes cluster
When the resource group is created, a new Kubernetes cluster can be added to the group:
az aks create --resource-group mpn-rg-kubernetes --name mykubernetescluster --node-count 1 --enable-addons monitoring --generate-ssh-keys
This command creates a new Kubernetes cluster with the name mykubernetescluster
and with a single node. This means that there will be one VM created in the Azure portal that is...