Azure Kubernetes Fundamentals: My Development Tools

Azure Kubernetes Service (AKS) is an orchestrating engine to run multiple containerized applications in a cluster. It is currently growing in the developer and cloud engineering community and gainer more adoption in the enterprise. Learning and working with AKS has known to have a steep learning curve. There are many parts and pieces to get your head wrapped around and how they all work together. And the same goes with all the developer and engineering tools to build, deploy and manage and operate an AKS environment.

For those getting started and wondering what they need to build your tool belt, I will share what’s in my tool belt so this may start as a starting point to build your AKS tool belt. I like to mention that my background is very which Microsoft and windows platform based. Working with Kubernetes is getting me more exposure to the Open Source Software and Linux practices and software.

My Software and tools

My development machine operating system is Windows 10

Visual Studio Code (VS Code)

Lightweight but powerful source code editor. Free.
https://code.visualstudio.com/download

I prefer this tool as it is very light weight and very popular in the general developer community and not just with Microsoft-centric communities. I prefer it for its plugin extensions. Alternative IDEs, are any code editor you choose, including the latest version Visual Studio which has more rich capabilities.

Docker for Windows

Docker is a full development platform to build, run, and share containerized applications. Docker Desktop is the best way to get started with Docker on a Windows machine.

Docker Desktop has Kubernetes integrated. So you have a simple local Kubernetes cluster.

Using docker for windows is a main starting point for a developer to build and test containerized applications in your local machine.

Minikube

Minikube implements a local Kubernetes cluster on macOS, Linux, and Windows. minikube’s primary goals are to be the best tool for local Kubernetes application development and to support all Kubernetes features that fit.

This is another option to Docker Desktop’s OOTB Kubernetes cluster. I found this initially tricky to install and setup, especially with the hyper-v virtual switch on my windows 10 machine. This is solely for local development scenarios and not production. I tried this setup on an Azure VM and I don’t think it is supported well, so don’t bother trying.

Command Line Interface (CLI)

CLIs are text-based interfaces to execute commands against an application or system.

Docker

This is installed as part of Docker for Windows. Here is a Docker cheat sheet

Example commands

Build an image from the Docker file in the current directory
docker build -t helloworldimage:1.0

Run a container from the image
docker container run –name myApp -p 5000:80 helloworldimage:1.0

Docker Compose

Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your application’s services. I typically use this for testing the app locally and is optional as part of the Kubernetes app lifecycle.

Compose has commands for managing the whole lifecycle of your application:

  • Start, stop, and rebuild services
  • View the status of running services
  • Stream the log output of running services
  • Run a one-off command on a service

Example command:

Starts and runs your multi-container app based on the yaml file in the current directory
docker-compose up

Minikube

Minikube has its own CLI.

Example commands:

Start a cluster
minikube start

Access the Kubernetes Dashboard running within the minikube cluster
minikube dashboard

minikube makes it easy to open this exposed endpoint in your browser
minikube service hello-minikube

Kubectl

Helps manage and configure a kubernetes cluster, including Azure Kubernetes Service (AKS).

For the commands cheat sheet read https://kubernetes.io/docs/reference/kubectl/cheatsheet/

Example commands:

List all services in the namespace
kubectl get services 

Show pods
kubectl get pods

Create a Kubernetes resource
kubectl apply -f ./my-manifest.yaml

Knowing kubectl is core to being a kubernetes developer or engineer.

Helm

Helm helps you manage Kubernetes applications — Helm Charts help you define, install, and upgrade even the most complex Kubernetes application. Helm is a tool for managing Charts. Charts are packages of pre-configured Kubernetes resources.

Use Helm to:

  • Find and use popular software packaged as Helm Charts to run in Kubernetes
  • Share your own applications as Helm Charts
  • Create reproducible builds of your Kubernetes applications
  • Intelligently manage your Kubernetes manifest files
  • Manage releases of Helm packages

I find helm integral in packaging up your applications for deployment. It is fairly easy to work with, but have to understand its syntax. I find helm really useful to deploy applications freely available. A good example would be the nginx controller when setting up a kubernetes cluster.

Git

For source control management. This is a standard tool these days.

Azure CLI

Designed to get you working quickly and efficiently with Azure services, with an emphasis on automation.

For managing Azure Kubernetes, most examples lean towards Azure CLI vs Azure PowerShell. They both work well. I just end up using Azure CLI.

You can find the azure aks related commands at https://docs.microsoft.com/en-us/cli/azure/aks?view=azure-cli-latest

Example command

Creating an AKS cluster

az aks create -g MyResourceGroup -n MyManagedCluster –kubernetes-version 1.13.9 –vm-set-type AvailabilitySet

ARM Templates

To implement infrastructure as code for your Azure solutions, use Azure Resource Manager templates. The template is a JavaScript Object Notation (JSON) file that defines the infrastructure and configuration for your project. This is typically when you built your AKS cluster manually and have a good idea on the settings and relationships with other azure resources such as ACR, virtual networks and load balancers, that you want to build ARM templates to have an automated and repeatable deployment across dev, test and production environments.

You can find sample ARM templates related to AKS at https://github.com/Azure/azure-quickstart-templates/tree/master/101-aks. You can find other AKS related samples in this repo. At first it is a learning curve to get going and understand the syntax and how it all works. In my experiences it works well.

VS Code Extension: Azure Resource Manager Tools

Provides language support for Azure Resource Manager deployment templates and template language expressions. This is used to provide a better developer experience in VS Code when building out ARM Templates for AKS and its dependent azure resources such as virtual networks.


VS Code Extension: Kubernetes

The extension for developers building applications to run in Kubernetes clusters and for DevOps staff troubleshooting Kubernetes applications.

I really like this tool and use it regularly. I like how I can easily change between different AKS clusters either in Azure, minikube or Docker Desktop. I prefer any GUI management over CLI.

Works with any Kubernetes anywhere (Azure, Minikube, AWS, GCP and more!).

Skaffold

Skaffold handles the workflow for building, pushing and deploying your application, allowing you to focus on what matters most: writing code.

This tool is more for the app developer in a dev environment. A scenario that is cool is when a developer makes a change in the code, scaffold will build an image and can deploy the helm chart into your development Kubernetes environment. It basically streamlines the process from code to running app in Kubernetes. I think of it as a mini CI/CD pipeline, although it an integrate into a rigorous CI/CD pipeline tool such as Azure DevOps Pipelines.

Tools I plan to explore and will update this blog post to share my experiences and opinion:

Istio as a service mesh

Istio helps reduce the complexity of these deployments, and eases the strain on your development teams. It is a completely open source service mesh that layers transparently onto existing distributed applications. It is also a platform, including APIs that let it integrate into any logging platform, or telemetry or policy system.

Prometheus for monitoring

Prometheus is a popular open source monitoring and alerting toolkit. Prometheus can integrate with Azure Monitor for containers.

Typically, to use Prometheus you need to setup and manage a Prometheus server with a database. With the Azure Monitor integration, no Prometheus server is needed.

Conclusion

I have shown a lap around the tools I have used in practice and real-world scenario given my windows background. I plan to update this blog post further as I continue to build my toolbelt and get more in depth with other technical scenarios using these tools. I hope this helps you start your Kubernetes development journey as you decide what your tool belt will hold.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s