DEV Community

Cover image for Azure Kubernetes Service - A Beginner's Guide.
Jay Gordon for Microsoft Azure

Posted on • Edited on

Azure Kubernetes Service - A Beginner's Guide.

In this new video, I am going to provide you with a bunch of new information on how to use Azure Kubernetes Service with a really simple application. You'll need to have an Azure account to follow along, so sign up for your free Azure $200 in credits and 12 months of services.

Some of the core concepts I want you to be sure to pay attention to are:

What will I learn to do in this video?

In this video, I created a way for you to understand how to begin using the Azure Kubernetes Service without needing lots of previous experience. I won't be creating the underlying infrastructure for Kubernetes. In this experience, I am electing to give you what is a typical use-case for those who want to deploy an application without managing all the infrastructure.

Kubernetes helps manage service discovery, incorporate load balancing, track resource allocation, scale based on compute utilization, check the health of individual resources, and enable apps to self-heal by automatically restarting or replicating containers.

If you'd like to work with some deeper information about how to create Kubernetes clusters on your own, Xander Grzywinski of the AKS SRE team has put together a Kubernetes the Hard Way (On Azure)

In this demo video, our application makes use of the tools associated with Azure Kubernetes Service to make deployment simple. Follow along to build a basic "Hello World!" application to help you begin your journey into the world of using Kubernetes. You can download it here on Github.

Commands I might want to copy and paste from the video!

Create a resource group - just replace the group, select a different location if you'd like to!
az group create --name YOURGROUPNAME --location eastus

Create role based access control credentials
az ad sp create-for-rbac --skip-assignment

Create your AKS cluster with RBAC credentials, replace with your resource group name and a name for your AKS cluster
az aks create --resource-group YOURRESOURCEGROUP --name YOURCLUSTERNAME \
--enable-addons monitoring,http_application_routing \
--kubernetes-version 1.14.3 --generate-ssh-keys \
--service-principal application-id-from-rbac --client-secret client-secret-from-rbac

Get your cluster credentials for kubectl
az aks get-credentials --resource-group YOURRESOURCEGROUP --n YOURCLUSTERNAME

Create ACR
az acr create --resource-group YOURRESOURCEGROUP --name YOUR_ACR_NAME --sku Standard

Clone Repo
git clone git@github.com:jaydestro/demo-app.git
cd demo-app

Build container from repository
az acr build --registry YOUR_ACR_NAME --image demo-app:latest .

Apply deployment
kubectl apply -f ./deployment.yaml

Apply loadbalancer service
kubectl apply -f ./loadbalancer.yaml

Get Loadbalancer Service
kubectl get service -l demo-app -w

Next Steps

When you're done, you can delete your resource group easily:

az group delete --resource-group YOURGROUPNAME

or keep your cluster and start learning how to implement a pipeline for CI/CD. You can use tools like Azure DevOps that works with any language or any platform!

Thanks for following along in this video, feel free to leave me comments or reach out on Twitter at @jaydestro. I absolutely love learning along with you all and will continue to build new videos like this to help you learn!

Top comments (0)