Jump to content

Creating an AKS Cluster in Azure: Considerations for Migrating from EKS Workloads


Recommended Posts

Guest rkemery
Posted

Create an AKS cluster in Azure and learn more about the workflow from start to finish - along with considerations when migrating from EKS workloads to AKS!

 

 

 

1. Navigate to Microsoft Azure

 

2. Click the "Search resources, services, and docs (G+/)" field.

 

06ba87d0-0ec7-4c29-96cd-208f502a5124.jpg.67056923fc2b181f3cb2e4f06d60f580.jpg

 

3. Type "aks"

 

4. Click "Kubernetes services"

 

e6450627-0b9d-42f4-9533-5c455738665a.jpg.e12940a97ec3d88cc824fd2ba0c8e2a7.jpg

 

5. Click this icon to begin creating a Kubernetes service deployment.

 

7f5b2296-b90e-498b-ab0e-0b7b45927975.jpg.c6e43dded21888079a2bf6dea89b0d53.jpg

 

6. Click "Create a Kubernetes cluster" to begin the workflow.

 

e404c5b6-2136-4ae5-880d-09cb08785a01.jpg.366fff031eaab4215e37da8ed504de15.jpg

 

7. Click "(New) Resource Group" for the AKS deployment; both AWS and Azure have the concept of Resource Groups; however, Resource Groups are compulsory for all resources in Azure where AWS it's optional. Some other key items are that one Azure resource is always associated with one Resource Group and it can be organized via tags. You can also manage them with the Web Interface (Azure Portal), REST API, Command Line, PowerShell, or ARM Templates.

 

1af4b7ea-bc2e-44f9-8332-7ba32254a92d.jpg.dfc9424f0b48b08952b0fa9a61e8e0f9.jpg

 

8. I have an example Resource Group created named "rk-aks-demo" that I will use.

 

ace446c5-d9b1-41bc-8924-c7a25e8c24c8.jpg.3fa9a99ec7a8aabf271afc076b7f9b8b.jpg

 

9. For demo purposes, we will use the "Dev/Test" Cluster preset configuration. One advantage in this workflow compared to AWS is that we offer several presets. These are 5 levels of presets that offer different advantages for cost and features/workloads that can get you started quick.

 

e71e7647-3821-40b3-a042-5562842660c5.jpg.0d20dad15bc92782bccddab03fd62673.jpg

 

10. For demo purposes and Dev/Test environment, click "Best for experimenting with AKS or deploying a test app." Dev/Test will set system node pool size to B4ms shape with Cluster Autoscaling and 99.5% API server availability.

 

4bd561a6-2b66-4c5e-a1bd-0bb9b5733853.jpg.1c3438c45085e4d046b992284fdcf7a5.jpg

 

11. Create a name for your cluster - click the "Kubernetes cluster name" field and enter it.

 

1e333ee2-8278-4c00-92d6-3b697b2fe538.jpg.bd8cbc6e2a0dfd665bb7cd393929ab7b.jpg

 

12. Since am I close to the Central US Azure datacenter, I chose it as my Region. Click "(US) Central US"

 

43e4c1f1-5853-4943-a708-ed54eb901ac2.jpg.99f17811391f56b4f43c31ec4a162bbd.jpg

 

13. During setup of AKS, it is important to understand production workloads and plan for resilience against datacenter failures. AKS clusters that are deployed using availability zones can distribute nodes across multiple zones within a single region - improving cluster availability. This is also the recommended approach when considering migrating from Amazon EKS to AKS.

 

758d4768-e852-4d10-bf28-7a5170b355f0.jpg.549663f1eae64e80b2b2b18f07c5ed27.jpg

 

14. Description of Availability Zones during setup.

 

00a5bcae-ed2d-4f5b-b18a-5614462156db.jpg.a105bfcaac007ddc70bfb373d8e502b8.jpg

 

15. We will use the default k8s version selected. Note this may be different depending on the time you create the cluster as these options change as new versions get released. Click the version with "(default)" in it. You have the option to move to older and new (preview) releases right from the start. When migrating from EKS to AKS it is important to ensure your target k8s version is within the supported window for AKS.

 

f16d1f3a-3d62-4907-882f-49e2020a6a6e.jpg.f91d69c843c8778b1e8fd20667191835.jpg

 

16. Since this is a demo, we can select 99.5% API server availability. API server availability is an uptime service level agreement that guarantees a Kubernetes API server uptime of 99.95% clusters with one or more availability zones and 99.9% for all other clusters.

 

0bf8f12e-b515-4611-b783-721d3f91cad6.jpg.7da1f0f199840f0f5f3f80a8ec64d2df.jpg

 

17. In continuation of selecting an appropriate k8s version in line with our considerations from EKS to AKS, we can also select automatic upgrades. "Enabled with patch (recommended)" will update the cluster to the latest patch version within the set minor version. We also have the option to select stable, rapid, node image, and disabled - depending on our workloads on EKS we might select stable for production workloads.

 

2664bf2f-d7c9-42c3-874a-944484bfe2c1.jpg.bc4de3c750b884141038c1144c0565b9.jpg

 

18. Sizing the k8s nodes is important when considering EKS to AKS. The types of workloads and their usage will influence the choice of how many nodes and what node size we use for the cluster. It is also important to consider valid quotas for the migration. You should verify that your quotas and limits are sufficient for these resources and if necessary, request and increase in vCPU quota.

 

83f9a89e-a3aa-4501-beff-bc8765a5072f.jpg.f7be3822735bf5ee371c1cbdb3919bac.jpg

 

19. We can also select the min and max of nodes to use for autoscaling. If your EKS cluster uses autoscaling and was engineered for high availability and business continuity with respect to elasticity - then the number of nodes is important.

 

474fd778-e019-4bb4-8526-ae3907c0a8c3.jpg.4f918300fe0131e0df39ee084f6894cb.jpg

 

20. Go to the next page and click "Next: Node pools >" Here we can configure additional node pools to handle a variety of workloads and in contrast to EKS, we can enable "virtual nodes" right from the start for Azure Container Instance fast burst scaling. We can also select the type of node pool OS disk encryption - important if you are planning to migrate from EKS with your own keys.

 

7da0ce73-bc0e-4c59-bbc7-c3d36403f6cb.jpg.1bb273c16d35d54529c90f24cca3d721.jpg

 

21. Next, we can move to Access. Click "Next : Access >"

 

53a7e7c3-45e2-4c99-82ab-78404cece11f.jpg.f9caf6788b444966eaecb9e90db81022.jpg

 

22. AKS setup allows for 3 types of authentication and authorization: Local accounts with k8s RBAC, Azure AD authentication with k8s RBAC, and Azure AD authentication with Azure RBAC. One strength of AKS is its tight coupling with Azure AD to use Azure role assignments for authorization checks on the cluster.

 

62c547b7-c684-48cd-8834-1ff44082e2c9.jpg.90d8e5ee2a9cc06126cc1cb0e9287de8.jpg

 

23. Next, we will go to the Networking overview. Click "Next : Networking >"

 

54491cf1-3175-4edc-89fa-8f07f8c2076f.jpg.9185af5bcc6ebaab973229bca6367944.jpg

 

24. Networking is very important when considering migrating from EKS to AKS. It is important to inventory the range of services and applications that uses them in the EKS cluster and then follow best practices for downtime handling. You might typically migrate over time rather than all at once, meaning old and new environments might need to communicate over the network. If an application previously used ClusterIP services to communicate, they might need to be exposed as LoadBalancer type and secured appropriately after the migration. Ideally, you want to point clients to new services that are running on AKS and we recommend that you redirect traffic by updating DNS to point to the Load Balancing sitting in front of your AKS cluster - Azure Front Door can direct customers to the desired k8s cluster and application instance.

 

eadc691d-7d9e-4640-ac87-3ce68c530118.jpg.a0abb879f55f6f49b01bb33beb68e542.jpg

 

25. In the network section, we can define and create a new virtual network. Both Azure VNet and AWS VPC segregate networks with subnets. Azure VNet assigns resources connected and deployed to the VNet a private IP address for the CIDR block specified and the smallest subnet supported is /29 and largest is a /8. Record the CIDR block range you need when migrating from EKS to AKS for k8s services and and the cluster as you do not want to experience IP exhaustion and also want to be able to scale accordingly.

 

6deca65f-84c9-4f9a-9a67-4ec2057a6a17.jpg.61d15f142ac9140cdcdc4f9fe1ab606a.jpg

 

26. The k8s service address range description.

 

0b0c9b8c-acf1-4c34-897b-36cba1ec0cb9.jpg.a2babf9c018aede64ea32f9ee040cba4.jpg

 

27. The k8s DNS service IP address description.

 

c115e542-c0f9-4aef-86ff-29097b5919f1.jpg.86b7de634689b9ea6b2f7aeb026cef07.jpg

 

28. You can also change the network for the Docker Bridge address - Click "Docker Bridge address"

 

a1aaef8e-a14d-4534-a23e-dd926baf9d9c.jpg.a10aa303a26ad53b37b535c2e04ab621.jpg

 

29. Description for DNS name prefix for the hosted k8s API server FQDN - important to consider when migrating as this will be used to connect to when managing containers after creating the cluster.

 

bc109ae7-fc93-4610-b810-a73954ca8786.jpg.a89ba103b86d1ae04032305401377985.jpg

 

30. Enabling "HTTP Application Routing" will configure an ingress controller in your AKS cluster and as applications are deployed, the ingress controller will create publicly accessible DNS names for your application endpoints. Consider what this might mean for your applications as your migrate over - how many and what needs to be publicly available via ingress and what type of configurations are currently in place that need to be done in the new cluster.

 

746debfd-7e41-479c-9637-05326d850e0e.jpg.654d9f49698909d1efbef54c20ea2591.jpg

 

31. In this section, we can select the type of network policy structure for the k8s cluster. We can use Calico or Azure - Azure being one of the key differentiators out of the box vs EKS. Azure allows for Azure Network Policies via Azure Network Policy Manager (NPM) which uses IPTables for Linux and Host Network Service (HNS) ACLPolicies for Windows.

 

6f037d8d-a1c2-4f70-8b15-89411f1035b9.jpg.0b2270e3d90b7c63c876d7ad45345222.jpg

 

32. Click "Next : Integrations >"

 

e4046117-4bb8-4bca-abb2-f59bc1a51d73.jpg.ed8ccfbcbfa5ff4096bfbcc090cc51c9.jpg

 

33. Out of the box, we can enable Microsoft Defender for Cloud which provides unified security management and threat protection across the workloads - importantly when migrating production workloads we want to consider the security policies and protection against threats as we build in AKS. Using Defender backed with Azure Monitor and Azure Policy allows for threat protection, container insights, and at-scale enforcements and safeguards for AKS clusters in a centralized, consistent manner through Azure Policy.

 

672f4858-fea8-43e4-879b-0c1faad606be.jpg.3bddd7c7b6853e71221f211ae3ff2aa0.jpg

 

34. When migrating from EKS to AKS, we likely will have a set of images that are pre-built or need built for the new cluster; we can use tools like Azure Migrate to help with that along with connecting the AKS cluster to Azure Container Registry to store and use these images.

 

23e07b11-7247-46e9-99ce-1e5116c254a1.jpg.67874c6eec1e7405d2cf7cac39d0258c.jpg

 

35. Click "Next : Advanced >"

 

17b75b36-de22-4793-867b-7d6443bb722e.jpg.05684326404a39b1bbca233f6aa294a1.jpg

 

36. When migrating from EKS to AKS, it is important to know the type of data persistence and where the new data will be stored. When we create the AKS cluster, we have the option to enable secret store CSI driver which also allows us to integrate Azure Key Vault secrets. Ideally, when we migrate persistent volumes, we want to quiesce writes to the application, take snapshots of the disks, create new managed disks from the snapshots, create persistent volumes in AKS, update the pod spec to use existing volumes rather than static provisioning, then deploy the application to AKS, validate it and point live traffic to the new cluster. You can use tools like Azure CLI Disk Copy extension and Azure Kube CLI extension to migrate volumes between k8s clusters.

 

ec5ba131-d3e4-4c41-9f68-7153a94cadc9.jpg.3ea0750626f392bcbffab2ae24015b5a.jpg

 

37. Click "Next : Tags >" here we can tag the AKS cluster for certain things like environment.

 

3a5e786f-cd36-4be2-8aff-1cce4b653524.jpg.3285287bbf6b7d401d67cbe2907c7d43.jpg

 

38. We're ready to create our AKS cluster! Click "Next : Review + create >"

 

0c2f2cdb-3484-44b5-9cd3-ddca3df6b777.jpg.71710f8455841371fc44dce7c0e7cf41.jpg

 

39. After the cluster has been provisioned, we can connect to it by clicking "Connect to cluster"

 

b1965c0a-a842-489e-9a52-e7ee7fa54dd7.jpg.9a673d8ad18ea1493e7d228f5e5f62ac.jpg

 

40. We can quickly get a snapshot of the current environment using Cloud Shell - Click "Open Cloud Shell" - from here it gives us all the commands to run and even sets the account and credentials for us when we open Cloud Shell - then from here we can get deployments and list namespaces and being our EKS to AKS migration!

 

f745a879-63c7-43bf-9497-42144437c95c.jpg.a9a29c59ac663fed21eabb9bba8721a6.jpg

 

Continue reading...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...