<p>I want to know a brief explanation or an example of how to migrate a <code>Kubernetes</code> application to <code>GCP</code> from <code>AWS</code>.</p>
<p>What services are implicated like <code>EKS</code> or <code>EC2</code> and <code>GKE</code> or <code>Compute Engine</code>.</p>
<p>I'm very new to migration, I don't know too much about <code>AWS</code> and I recently started using <code>GCP</code>.</p>
<p>Thanks in advance.</p>

<p>It depends.</p>
<h1>At first, <code>AWS</code> -&gt; <code>GCP</code> resources mapping:</h1>
<p>At first, you'll want to know the mapping between <code>AWS</code> and <code>GCP</code> resources.
There are several articles:</p>
<ul>
<li><a href="https://osamaoracle.com/2020/06/19/services-mapping-aws-azure-gcp-oc-ibm-and-alibab-cloud/" rel="nofollow noreferrer">Cloud Services Mapping For AWS, Azure, GCP ,OCI, IBM and Alibaba provider – Technology Geek</a></li>
<li><a href="https://www.lucidchart.com/blog/cloud-terminology-glossary" rel="nofollow noreferrer">Cloud Terminology Glossary for AWS, Azure, and GCP | Lucidchart</a>:</li>
<li><a href="https://www.cloudhealthtech.com/blog/cloud-comparison-guide-glossary-aws-azure-gcp" rel="nofollow noreferrer">Cloud Services Terminology Guide: Comparing AWS vs Azure vs Google | CloudHealth by VMware</a></li>
</ul>
<h1>Migrate <code>AWS EKS</code> to <code>GCP GKE</code>: the hard way</h1>
<p>If your cluster is deployed with <strong>managed kubernetes</strong> service:</p>
<ul>
<li>from <code>Elastic Kubernetes Service</code> (<code>EKS</code>)</li>
<li>to <code>Google Kubernetes Engine</code> (<code>GKE</code>)</li>
</ul>
<p>Then it would be hard to migrate. Just due to complexity of <code>kubernetes</code> architecture and differences in the approaches of manage cluster in <code>AWS</code> vs<code> </code>GCP`</p>
<h1>Migrate VMs and cluster deployed using your own <code>k8s</code> manifest.</h1>
<p>If your <code>kubernetes</code> cluster is deployed on cloud virtual machines with <code>k8s</code> or <code>helm</code> manifests, then it would be easier.</p>
<p>And there are two ways:</p>
<ul>
<li>Either migrate <code>VM</code>s using <code>GCP</code> <code>Migrate Connector</code> (as @vicente-ayala said in his answer)</li>
<li>Or import your infrastructure to the <code>terraform</code> manifest, change resources definitions step-by-step, and then apply this updated manifest to <code>GCP</code></li>
</ul>
<h2>Migrating with <code>Migrate Connector</code></h2>
<p>You can found the latest migration manual on migrating VM's here:</p>
<h3>Prerequisites</h3>
<p>As per <a href="https://cloud.google.com/migrate/compute-engine/docs/5.0/how-to/migrating-vms" rel="nofollow noreferrer"><code>GCP</code> manual</a>,</p>
<blockquote>
<p>Before you can migrate a source VM to Google Cloud, you must configure the migration environment on your on-premises data center and on Google Cloud. See:</p>
<ul>
<li><p><a href="https://cloud.google.com/migrate/compute-engine/docs/5.0/how-to/enable-services" rel="nofollow noreferrer">Enabling Migrate for Compute Engine services</a></p>
</li>
<li><p><a href="https://cloud.google.com/migrate/compute-engine/docs/5.0/how-to/migrate-connector" rel="nofollow noreferrer">Installing the Migrate Connector</a></p>
</li>
</ul>
</blockquote>
<h2>Migrating</h2>
<p><a href="https://cloud.google.com/migrate/compute-engine/docs/5.0/how-to" rel="nofollow noreferrer">How-to Guides  |  Migrate for Compute Engine  |  Google Cloud</a></p>
<ul>
<li><a href="https://cloud.google.com/migrate/compute-engine/docs/5.0/how-to/migrating-vms" rel="nofollow noreferrer">Migrating individual VMs</a></li>
<li><a href="https://cloud.google.com/migrate/compute-engine/docs/5.0/how-to/migrating-vm-groups" rel="nofollow noreferrer">Migrating VM groups</a></li>
</ul>
<h1>Migrating using <code>Terraform</code> and <code>Terraformer</code></h1>
<p>There is a great tool for reverse Terraform <a href="https://github.com/GoogleCloudPlatform/terraformer" rel="nofollow noreferrer">GoogleCloudPlatform/terraformer. Infrastructure to Code</a></p>
<p>A CLI tool that generates <code>tf</code>/<code>json</code> and <code>tfstate</code> files based on existing infrastructure (reverse Terraform).</p>
<p>And you can import your infrastructure into <code>terraform</code> manifest:</p>
<pre><code> terraformer import aws --resources=vpc,subnet --connect=true --regions=eu-west-1 --profile=prod
</code></pre>
<p>You'll get the <code>terraform</code> manifest declared with <a href="https://registry.terraform.io/providers/hashicorp/aws/latest" rel="nofollow noreferrer"><code>aws provider</code></a></p>
<p>And you may try to replace every <code>AWS</code> resource to the appropriate <code>GCP</code> resource. There is official <code>terraform GCP</code> provider: <a href="https://registry.terraform.io/providers/hashicorp/google/latest" rel="nofollow noreferrer">hashicorp/google</a>. Unfortunately, there isn't mapping for <code>terraform</code> resources of both cloud providers. But, again, you may some of these mapping lists:</p>
<ul>
<li><a href="https://osamaoracle.com/2020/06/19/services-mapping-aws-azure-gcp-oc-ibm-and-alibab-cloud/" rel="nofollow noreferrer">Cloud Services Mapping For AWS, Azure, GCP ,OCI, IBM and Alibaba provider – Technology Geek</a></li>
<li><a href="https://www.lucidchart.com/blog/cloud-terminology-glossary" rel="nofollow noreferrer">Cloud Terminology Glossary for AWS, Azure, and GCP | Lucidchart</a>:</li>
<li><a href="https://www.cloudhealthtech.com/blog/cloud-comparison-guide-glossary-aws-azure-gcp" rel="nofollow noreferrer">Cloud Services Terminology Guide: Comparing AWS vs Azure vs Google | CloudHealth by VMware</a></li>
</ul>
<p>And then apply the new <code>GCP</code> manifest:</p>
<pre><code>terraform init
terraform plan
terraform apply
</code></pre>
<h1>Additional resources on <code>AWS</code> &lt;-&gt; <code>GCP</code></h1>
<ul>
<li><a href="https://insights.daffodilsw.com/blog/gcp-to-aws-migration-why-and-how-to-make-the-move" rel="nofollow noreferrer">GCP to AWS Migration: Why and How to Make the Move</a></li>
<li><a href="https://www.youtube.com/watch?v=OCQx-neI5UY" rel="nofollow noreferrer">GCP | Google Cloud Migrate for Compute Engine | AWS to GCP Migration using Velostrata - YouTube</a></li>
<li><a href="https://www.youtube.com/watch?v=WdqQEcEUwRE" rel="nofollow noreferrer">Managing a Large and Complex GCP Migration (Cloud Next '19) - YouTube</a></li>
<li><a href="https://www.leverege.com/blogpost/lessons-learned-migrating-from-gcp-to-aws" rel="nofollow noreferrer">Lessons Learned Migrating from GCP to AWS | Leverege</a></li>
<li><a href="https://searchcloudcomputing.techtarget.com/tip/How-to-approach-a-GCP-to-AWS-migration" rel="nofollow noreferrer">How to approach a GCP-to-AWS migration</a></li>
<li><a href="https://www.rapyder.com/case-studies/gcp-to-aws-case-study-ride-sharing-platform/" rel="nofollow noreferrer">How Rapyder helped ride-sharing app migrate from GCP to AWS | Rapyder</a></li>
<li><a href="https://biqmind.com/wp-content/uploads/2020/04/Biqmind-CloudMigration-UseCase-2020-04.pdf" rel="nofollow noreferrer">Cloud Migration Use Case: Moving From AWS to GCP (PDF)</a></li>
</ul>
