Installation of kubernetes on Azure virtual machines

kubernetes installation guide

This is a demo guide of how to install kubernetes master and worker nodes on Microsoft Azure standalone virtual machines.

This guide is not intended as a solution for production purposes.


This guide assumes that you have a Microsoft Azure account and that you installed the Azure CLI and you are logged in to the respective subscription in Azure.

First steps

To create a resource group:

az group create -n rg_k8sdemo --location eastus2 --tags Purpose=Education

To create a VNET:

az network vnet create \
--resource-group rg_k8sdemo \
--name vnet-k8s-101519 \
--address-prefix \
--subnet-name subnet-k8s-101519 \

To create a virtual machine (as master):

az vm create \
--location eastus2 \
--size Standard_B1ms \
--resource-group rg_k8sdemo \
--image UbuntuLTS \
--computer-name my-k8s-master-00 \
--name k8s-101519-master-00 \
--vnet-name vnet-k8s-101519 \
--subnet subnet-k8s-101519 \
--storage-sku Standard_LRS \
--ssh-key-values .ssh/ \
--tags role=master

Read more

Basic kubernetes commands to investigate an issue

There are many usage cases of kubernetes and, hence, very distinct support scenarios when it deals to supporting a kubernetes issue. In my experience, I would call the following basic kubernetes commands to investigate an issue, as the most useful -and necessary- to accompany any kubernetes issue report.

Basic kubernetes commands to investigate an issue
kubectl version
kubectl cluster-info
kubectl get nodes -o wide
kubectl get pods --all-namespaces -o wide
kubectl get deployments --all-namespaces
kubectl get svc --all-namespaces -o wide

On the same time, I would include these couple of Docker commands:

docker -v
docker ps

To speed up any kubernetes troubleshooting, I’d recommend to provide the output of those commands in TXT format, rather than taking a screenshot.

Do you have any other experienced-based basic kubernetes command you would add to this list? Please share in the comments section.