Skip to the content.

⚒️ Workshop Pre Requisites

As this is a completely hands on workshop, you will need several things before you can start:

Install dependencies

The above listed tools are already set up in .devcontainer folder located in the git repository of this workshop: https://github.com/benc-uk/kube-workshop. If you’ve never used Dev Containers, check out developing inside a Container using Visual Studio Code Remote Development.

Install dependencies manually

Alteratively you can can install the dependencies yourself by following the steps below.

🌩️ Install Azure CLI

To set-up the Azure CLI on your system, install it in one of the below ways.

On Ubuntu/Debian Linux, requires sudo:

curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash

On MacOS, use homebrew:

brew update && brew install azure-cli

If the commands above don’t work, please refer to: https://aka.ms/azure-cli

⛑️ Install Helm & Kubectl

Install Helm & Kubectl - Linux (Ubuntu/Debian)

Two ways are provided for each tool, one without needing sudo, the other requires sudo, take your pick but don’t run both!

By default the ‘no sudo’ commands for helm & kubectl install binaries into ~/.local/bin so if this isn’t in your PATH you can copy or move the binary elsewhere, or simply run export PATH="$PATH:$HOME/.local/bin"

# Install kubectl - no sudo
curl -s https://raw.githubusercontent.com/benc-uk/tools-install/master/kubectl.sh | bash

# Install kubectl - with sudo
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x ./kubectl
sudo mv ./kubectl /usr/bin/kubectl

# Install helm - no sudo
curl -s https://raw.githubusercontent.com/benc-uk/tools-install/master/helm.sh | bash

# Install helm - with sudo
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
Install Helm & Kubectl - MacOS
# Install kubectl - with sudo
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/darwin/amd64/kubectl"
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl

# Install Helm
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash

⚙️ Set up bash profile

Set up the user bash profile for K8s to make it easier to run all the commands

echo "source <(kubectl completion bash)" >> ~/.bashrc
echo "alias k=kubectl" >> ~/.bashrc
echo "complete -o default -F __start_kubectl k" >> ~/.bashrc
echo "export PATH=$PATH:/home/azureuser/.local/bin" >> ~/.bashrc

To have .bashrc changes take affect in your current terminal, you must reload .bashrc with:

. ~/.bashrc

✅ Verify installation

Double check that everything in installed and working correctly with:

# Try commands with tab completion
k get pods -A
helm
az

🔐 Login to Azure

The rest of this workshop assumes you have access to an Azure subscription, and have the Azure CLI working & signed into the tenant & subscription you will be using. Some Azure CLI commands to help you:

😢 Stuck?

Getting all the tools set up locally is the highly recommended path to take, if you are stuck there are some other options to explore, but these haven’t been tested:

💲 Variables File

Although not essential, it’s advised to create a vars.sh file holding all the parameters that will be common across many of the commands that will be run. This way you have a single point of reference for them and they can be easily reset in the event of a session timing out or terminal closing.

Sample vars.sh file is shown below, feel free to use any values you wish for the resource group, region cluster name etc.

Note: The ACR name must be globally unique and cannot contain hyphens, dots, or underscores.

RES_GROUP="kube-workshop"
REGION="westeurope"
AKS_NAME="__change_me__"
ACR_NAME="__change_me__"
KUBE_VERSION="1.27.1"

Note: New versions of Kubernetes are released all the time, and eventually older versions are removed from Azure. Rather than constantly update this guide the following command can be used to get the latest version: az aks get-versions --location "westeurope" -o tsv --query "orchestrators[-1].orchestratorVersion"

To use the file simply source it through bash with the below command, do this before moving to the next stage.

source vars.sh

It’s worth creating a project folder locally (or even a git repo) at this point, in order to keep your work in, you haven’t done so already. We’ll be creating & editing files later

Return to Main Index 🏠Next Section ⏩