Azure Kubernetes Service (AKS) on Azure Arc

Jonathan
3 min readMar 29, 2021

Azure Arc is one of the latest Azure services that allow administrators to have have capability of managing cloud IaaS, Kubernetes (K8s) clusters and data services with an unified experience, meaning to be able to have an overview from Azure portal. Essentially, every resource needs to install Azure-Arc-related extensions to get connected to the platform. If you would like to learn more about how Azure Arc works, please take a look here.

For this article, we would focus on getting K8s cluster onboarded to Azure Arc. Since I do not have the physical servers to “actually” simulate the K8s-onboarding process, I went through the Azure Arc Jumpstart tutorial for getting the same onboarding experience.

This is meant to be easy as the tutorial already provided the script you would need to execute. This script would not only deploy a whole new AKS cluster in the target resource group but also install all the required extensions within the AKS cluster. So, it is really a one-liner to make life easier.

az group create --name Arc-AKS-Demo --location "East US"
az deployment group create \
--resource-group Arc-AKS-Demo \
--name arcaksdemo01 \
--template-uri https://raw.githubusercontent.com/microsoft/azure_arc/main/azure_arc_k8s_jumpstart/aks/arm_template/azuredeploy.json \
--parameters azuredeploy.parameters.json

However, if any of you is like me that always fail to deploy resource through ARM template, worry not. Please follow the steps below to achieve the same goal.

  • We first deploy an AKS cluster just like how we would do in normal situation.
  • When browsing through ‘azuredeploy.json’ from above script, you would notice there is a part for executing shell scripts and another part of onboarding the AKS cluster with pre-provisioning Azure Active Directory (AAD) service principal (SP) (yellow part).

** Please ensure all the variables in the shell script has values (pink part). As you are manually executing the script, it would not read the values from the environment, meaning it might require you to manually set the values.

** Please ensure SP has enough permissions to perform actions it needs to perform. To save time, you could temporarily provide contributor role to the entity (blue part).

** The script could also be found in the downloaded Git folder under

<whateverdirectory>/azure_arc/azure_arc_servers_jumpstart/azure/linux/arm_template/scripts/install_arc_agent.sh
  • After the process completes, you would be seeing a new Kubernetes — Azure Arc resource being created in the same resource group. It is leveraging the same AKS icon but with a blue disk underneath, representing this is K8s “on” Azure Arc.

Unfortunately, I could not get Linux and Windows servers onboard with ARM template, either and I might create a GitHub issue to address that shortly. Hopefully, by the time you try this, the onboarding experience would feel like a breeze! Happy learning!

--

--

Jonathan

Started my career as a consultant, moved to support engineer, service engineer and now a product manager. Trying to be a better PM systematically every day.