Google Cloud Anthos Series: Migrate for Anthos and GKE

Google Cloud Anthos Series: Part 8

Pushkar Kothavade
Google Cloud - Community
5 min readApr 1, 2022

--

Welcome to Part-8 of the ‘Google Cloud Anthos series’. You can find the complete series Here

Note: The company names (Samajik and Purogami) and personas (Ram and Guhan) mentioned in the storyline are fictional

Migrate for Anthos and GKE

This tool makes it fast and easy to modernize traditional applications away from virtual machines and into native containers. Find this tool in Anthos dashboard with the name ‘Migrate to containers’.

Anthos Dashboard: Migrate for containers

Use Migrate for Anthos and GKE to convert VM-based workloads into containers that run on Google Kubernetes Engine (GKE) or Anthos clusters. Workloads from VMs that run on VMware, AWS, Azure, or Compute Engine can be migrated to GCP in container format with ease.

Migrate VMs running on VMware, AWS, Azure, or Compute Engine to containers

This unique automated approach extracts the critical application elements from the VM so that those elements can be easily inserted into containers in GKE or Anthos clusters without the VM layers (like Guest OS) that become unnecessary with containers.

This significantly reduces the cost and labor that would be required for a manual application modernisation project. Post migration customer’s DevOps team gets modern controls offered by the GKE/Anthos to manage these applications.

Compatible operating systems and Kubernetes versions.

Migrate for Anthos and GKE : Quickstart Guide

In this Quickstart hands-on guide, Create a simple Compute Engine virtual machine (VM) on GCP first then use ‘Migrate for Anthos and GKE’ to migrate the VM to a Google Kubernetes Engine (GKE) processing cluster in the Cloud.

PART-1: GCE VM Setup

Create a GCE VM on Google cloud platform and install simple Apache web server application on it.

1.1. Setup Env Variables

1.2. Create a VM with a web server

1.3. Create a Firewall Rule

1.4. SSH to the VM & Install the apache2 Package

1.5. Verify the Installation

Open the browser and type http://<quickstart-instance-Public-IP>

1.6. Stop the VM

PART-2: GKE Processing Cluster Setup

2.1. Creating a processing cluster

Create a GKE cluster in the Cloud that you use as a processing cluster. This is where you install Migrate for Anthos and GKE and execute the migration.

PART-3: Install ‘Migrate for Anthos and GKE’

3.1. Create the m4a-install service account

3.2. Grant the storage.admin role to the service account

3.3. Download the key file for the service account

3.4. Connect to the cluster

3.5. Set up Migrate for Anthos and GKE components on the processing cluster

3.6 Validate the Migrate for Anthos and GKE installation

PART-4: Migrating the VM: Create Service Account

4.1. Create the m4a-ce-src service account

4.2. Grant the compute.viewer role to the service account

4.3. Grant the compute.storageAdmin role to the service account

4.4. Download the key file for the service account

4.5. Create the migration source

PART-5: Migrating the VM: Create a migration

5.1. Create a migration Plan

5.2. Check the migration status

5.3. Download the migration plan

5.4. Migrate the VM using the migration plan

5.5. After the migration begins, check its status until it finishes

PART-6: Deploying the migrated workload

6.1. Once the migration is complete, download the generated YAML artefacts

6.2. Add following service to the ‘deployment_spec.yaml’ file

6.3.Apply the deployment spec YAML to deploy the workload

6.4. Check for an external IP address

6.5. Test the migration by opening a browser and visiting the web page at the external IP address

Check ‘Migrate to containers’ Dashboard under ‘Kubernetes Engine’ section on GCP console.

Reference

https://www.youtube.com/playlist?list=PLIivdWyY5sqLbI6lgiwBLI6OJ94X7AjNW

Coming up..

In this blog we discussed ‘Migrate for Anthos & GKE’ tool to migrate VMs to containers. In upcoming blogs we will continue the Samajik’s journey of Anthos adoption.

Contributors: Anchit Nishant, Shijimol A K, Dhandus

--

--