Azure Kubernetes Service - A Beginner's Guide.
Tags: beginners, kubernetes, azure, cloud
Published: 2019-07-22 19:29:26

In this new video, I am going to provide you with a bunch of new information on how to use [Azure Kubernetes Service](https://azure.microsoft.com/en-us/services/kubernetes-service/?WT.mc_id=devto-blog-jagord) 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.](https://azure.microsoft.com/en-us/free/?WT.mc_id=devto-blog-jagord)   

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


  * [Bash Quickstart for Azure Cloud Shell](https://docs.microsoft.com/en-us/azure/cloud-shell/quickstart?WT.mc_id=devto-blog-jagord)
  * [Kubernetes core concepts for Azure Kubernetes Service (AKS)](https://docs.microsoft.com/en-us/azure/aks/concepts-clusters-workloads?WT.mc_id=devto-blog-jagord)
  * [Service principals with Azure Kubernetes Service](https://docs.microsoft.com/en-us/azure/aks/kubernetes-service-principal?WT.mc_id=devto-blog-jagord)
  * [Azure Container Registry Documentation]
(https://docs.microsoft.com/en-us/azure/container-registry/?WT.mc_id=devto-blog-jagord)

# 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. 

 
![](https://thepracticaldev.s3.amazonaws.com/i/9t1pvgp853d2lxsai321.png)

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](https://twitter.com/xandergrzy) of the AKS SRE team has put together a [Kubernetes the Hard Way (On Azure)](https://medium.com/@XanderGrzy/kubernetes-the-hard-way-on-azure-b6b821958f72)

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](https://github.com/jaydestro/demo-app).

{% youtube pY-Qlz548WM %}

# 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](https://azure.microsoft.com/en-us/services/devops//?WT.mc_id=devto-blog-jagord) 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](https://twitter.com/jaydestro).  I absolutely love learning along with you all and will continue to build new videos like this to help you learn!