June 10, 2021 - infrastructure azure

Create a Multi-Cloud Infrastructure with Azure Arc

Xavier Geerinck

@XavierGeerinck

Azure Arc was released a while ago, but got a great update in May 2021 during the annual Build conference allowing it to run Azure Application services across your Azure Arc enabled Kubernetes services.

Introduction

In this article, I will explain how you can get started with Azure Arc. As Prerequisites I created the following on each cloud provider and on-premise infrastructure.

Azure Arc

To summarize Azure Arc in my own words: "it's a management plane for your Kubernetes Clusters and Phyiscal servers that allows you to manage your machines no matter where they sit".

In Azure terms: "Azure Arc offers simplified management, faster app development, and consistent Azure services. Easily organize, govern, and secure Windows, Linux, SQL Server and Kubernetes clusters across data centers, the edge, and multicloud environments right from Azure."

Personally, I find this an amazing tool with a low cost to manage your entire datacenter and cloud estate!

Creating an Azure Arc connected Cloud

So let's get started and create our clusters and servers! Each cloud has their own specificalities, but I would love to show you how you can create them on each one of them. The overall process is quite similar:

  • Server

    • Login an configure the Azure Arc agent
  • Kubernetes

    • Fetch the kubectl access
    • Configure Azure Arc with az cli

Azure Arc Connect Server

To connect a server, we navigate to Azure Arc in the Azure Portal

In there we can click on Servers which will open up the overview of our servers. On the Left top we can now click "add" to add a server.

Seeing that the process is quite similar, I won't go into detail of how you should do this for the different cloud providers. To connect your server, open op the "Add" page and navigate through the steps while selecting your resource group operating system.

Once you have done that you need to install the agent. In our case I was running Linux as an operating system. At this step we will now see the commands we should run to get Arc up and running

💡 Do not forget to switch to root with sudo su

Congratulations 🎉 you have now connected your server to Azure Arc!

Azure Arc Connect Kubernetes

We already have single servers configured, but how can we configure our Kubernetes clusters? Well this is a bit more tricky. For this we can follow these steps:

  1. Install Kubernetes (managed with AKS or GKE or through k3s for example)
  2. Install & Configure Kubectl
  3. Install Helm
  4. Run AZ CLI

💡 You can make things easier (as I did) by utilizing the Azure Cloud Shell and configure kubectl in it. If you are working with GKE, just copy the ~/.kube/config file content from GKE to Azure Cloud Shell and you can run kubectl get pods -A in your Azure Cloud Shell to connect to your GKE Kubernetes 😉

Showing this example on GKE (as Azure is straightforward with the shell), let's open up the Kubernetes pane and click "Add" again. We will now have to enter the subscription again, plus a cluster name (metadata) to name it.

Now we will be presented by the commands we need to execute to connect this Kubernetes cluster. Again, remember to have kubectl configured to connect to your cluster, then everything should be going smoothly!

As explained before, I opened up the Kubectl configuration and copied the GKE config towards the Azure Cloud Shell one (to skip installation of AZ CLI on GCP):

Once this has been pasted I verify to ensure kubectl get pods -A is working and showing my GKE pods.

Since that has been verified, I am now able to run the required commands and get cluster configured to Azure Arc.

We are now connected to Azure Arc, but let's for fun check on GKE to see our pods running (including the Azure Arc pods) in the Google Cloud Shell:

Final Overview

Looking at our final overview, this is what we have created, a beautiful server park consisting out of our Kubernetes clusters and Servers!

Conclusion

In this article I went in more details on how you can get started with Azure Arc and connect your existing Servers and Kubernetes clusters, no matter where they are running!

Did you enjoy reading? Or do you want to stay up-to-date of new Articles?

Consider sponsoring me or providing feedback so I can continue creating high-quality articles!

Xavier Geerinck © 2020

Twitter - LinkedIn