Voiced by Amazon Polly |
Introduction
Kubernetes Migration Factory (KMF) is a powerful tool designed to simplify and accelerate the migration of Kubernetes workloads to Amazon EKS. Built with Golang, KMF offers a command-line interface (CLI) that orchestrates and automates complex migration tasks, reducing the process from weeks of manual effort to just minutes.
With minimal input through the CLI, users can configure, launch, and track migration plans for their existing container platforms. KMF scans the source environment, generates a detailed blueprint of running workloads, and lists all the Kubernetes resources to be created on the target Amazon EKS cluster.
The tool understands source platform configurations and automatically adjusts manifest files to ensure compatibility with Amazon EKS. It can also suggest AWS-native services by analyzing existing workloads and recommending equivalent AWS resources. Additionally, KMF provides data plane setup recommendations based on current cluster metadata, making migrations smoother and more efficient.
Pioneers in Cloud Consulting & Migration Services
- Reduced infrastructural costs
- Accelerated application deployment
Prerequisites
- Azure AKS Cluster (Source)
- Amazon EKS Cluster (Destination)
- Install Go
- Download Kubernetes Migration Factory – https://github.com/awslabs/aws-kubernetes-migration-factory.git
- AWS CLI, EKSCTL, and Kubectl tools need to be installed on your workstation
- For AWS CLI installation, refer to the AWS documentation
- For EKSCTL installation, refer to the EKSCTL documentation
- For Kubectl installation, refer to the Kubernetes documentation
Note: Here, we will be using a Virtual Machine (Azure) and an Amazon EC2 Instance to install the prerequisites.
Creating and Managing Azure Kubernetes Service (AKS) Clusters with Application Migration Using Kubernetes Migration Factory (KMF)
Installing Go
Before beginning, ensure Go is installed on your system:
- Download Go:
1 |
curl -OL https://golang.org/dl/go1.16.7.linux-amd64.tar.gz |
2. Verify the download:
1 |
sha256sum go1.16.7.linux-amd64.tar.gz |
3. Extract the archive:
1 |
sudo tar -C /usr/local -xvf go1.16.7.linux-amd64.tar.gz |
4. Set Go’s path in your environment:
1 |
sudo nano ~/.profile |
5. Add the following line to the end of the file:
1 |
export PATH=$PATH:/usr/local/go/bin |
6. Apply the changes:
1 |
source ~/.profile |
7. Verify the installation:
go version
Creating an AKS Cluster
Azure Kubernetes Service (AKS) provides a managed Kubernetes environment that simplifies the deployment and management of containerized applications. To create an AKS cluster:
- Follow the official Microsoft documentation at: https://learn.microsoft.com/en-us/azure/aks/learn/quick-kubernetes-deploy-portal?tabs=azure-cli
- You can create a cluster using the Azure portal or Azure CLI based on your preference.
After creating your AKS cluster, you’ll need to authenticate and configure your environment:
- Authenticate to Azure:
1 |
az login |
This command will provide a URL and passcode to authenticate your Azure account.
2. Configure kubectl to communicate with your AKS cluster:
1 |
az aks get-credentials --resource-group AKSResourceGrp --name MyAKScluster |
This command downloads the kubeconfig file needed to access your cluster.
Setting Up Kubernetes Migration Factory
The Kubernetes Migration Factory (KMF) is a tool designed to streamline the migration of applications to Kubernetes environments.
- Clone the repository:
1 |
git clone https://github.com/awslabs/aws-kubernetes-migration-factory.git |
2. Navigate to the project directory:
1 |
cd kubernetes-migration-factory/ |
3. Build the KMF binary:
1 |
go build |
This builds the binary in the current directory as “containers-migration-factory”.
- Alternatively, create a shorter name for the binary:
1 2 3 4 5 |
go build -o ./bin/kmf Verify the binary was created: ls -l ./bin/kmf |
Troubleshooting Dependencies
If you encounter dependency issues during the build process:
- Download dependencies:
1 |
go mod download |
2. Tidy up dependencies:
1 |
go mod tidy |
3. Rebuild the project after resolving dependencies.
Deploying Sample Applications
To test your AKS cluster with a sample application:
- Follow the Microsoft guide for deploying sample applications: https://learn.microsoft.com/en-us/azure/aks/learn/quick-kubernetes-deploy-portal?tabs=azure-cli
- This will walk you through deploying, exposing, and testing a basic application on your new Kubernetes cluster.
Running KMF CLI
Running with a Config config.ini
From the operating system path from where you are making calls to ./bin/kmf, mAKS sure that you have a file with the name config.ini and provide all the required information. A sample config.ini file looks like below:
1 |
https://github.com/awslabs/aws-kubernetes-migration-factory/blob/main/config.ini |
To access the destination cluster, Update the Kubeconfig of the Amazon EKS cluster from the source cluster.
Screenshot of k8 resources running on the destination cluster
Screenshot of k8 resources running on the source cluster
We can migrate the required resources to the Amazon EKS cluster with the following command.
1 |
./bin/kmf --source_kubeconfig /home/azureuser/.kube/config --destination_kubeconfig /home/azureuser/.kube/config --namespaces "default" --resources "deployment, service, secrets, pods" --migrate_images "yes" --reg_names "dockerhub" --source_context MyAKScluster --destination_context arn:aws:eks:ap-southeast-1:730335384723:cluster/demo-eks --source_type AKS --helm_path /home/azureuser/kuberenetes-pocs/helm --action Deploy |
Screenshot of the k8 components migrated to destination cluster (Amazon EKS)
Sample application running as a service as a LoadBalancer
Conclusion
This guide has walked through the essential steps for setting up your AKS environment, installing the necessary tools, and preparing for application migration. By following these steps, you will establish a solid foundation for your Kubernetes infrastructure that can support modern application development practices and enable more efficient operations.
Drop a query if you have any questions regarding Azure Kubernetes Service and we will get back to you quickly.
Empowering organizations to become ‘data driven’ enterprises with our Cloud experts.
- Reduced infrastructure costs
- Timely data-driven decisions
About CloudThat
CloudThat is an award-winning company and the first in India to offer cloud training and consulting services worldwide. As a Microsoft Solutions Partner, AWS Advanced Tier Training Partner, and Google Cloud Platform Partner, CloudThat has empowered over 850,000 professionals through 600+ cloud certifications winning global recognition for its training excellence including 20 MCT Trainers in Microsoft’s Global Top 100 and an impressive 12 awards in the last 8 years. CloudThat specializes in Cloud Migration, Data Platforms, DevOps, IoT, and cutting-edge technologies like Gen AI & AI/ML. It has delivered over 500 consulting projects for 250+ organizations in 30+ countries as it continues to empower professionals and enterprises to thrive in the digital-first world.
FAQs
1. What version of Go is required for KMF?
ANS: – Go version 1.16 or higher is recommended for building the Kubernetes Migration Factory tool.
2. Can we use AKS with existing Azure resources?
ANS: – Yes, AKS can integrate with existing Azure resources such as Virtual Networks, Azure Monitor, and Azure Active Directory.

WRITTEN BY Deepika N
Deepika N works as a Senior Research Associate - DevOps and holds a Master's in Computer Applications. She is interested in DevOps and technologies. Deepika has strong expertise in AWS and Azure DevOps, Kubernetes (EKS), Terraform, and CI/CD pipelines. Proficient in infrastructure as code, automation, monitoring, security enforcement, and multi-cloud deployment strategies. Skilled in version control, infrastructure documentation, and cloud-native technologies and handling production workloads, container platforms, and DevSecOps practices.
Comments