2

We have one Kubernetes cluster running and we want to connect it to a new cluster. I found Google Clouds multicluster-service (MCS API) which seems promising, but it needs all clusters to be in the same VPC.

How do one migrate / move / add a running cluster to a VPC?

Harsh Manvar
  • 27,020
  • 6
  • 48
  • 102
NorwegianClassic
  • 935
  • 8
  • 26

1 Answers1

2

i think you can not move the cluster to another VPC, although you can create a new or clone the cluster to new VPC.

You can clone the existing one by using DUPLICATE tab in cluster details however it will just create infrastructure with the same config specs, during that time you can update Networking (VPC) as per need.

Once the duplicate(cloned) cluster is up & running in the desired VPC, you can start migrating your workloads, like deployment, secrets, stateful sets etc.

For workload migration you can checkout the tool : https://velero.io/

Velero is mostly useful for creating the backup & restore option.

it would be easy to migrate the workloads instead of going by applying the old YAML method however it's more on your setup.

Here is my small article about the migrating/cloning workload across GCP GKE clusters: https://faun.pub/clone-migrate-data-between-kubernetes-clusters-with-velero-e298196ec3d8

Harsh Manvar
  • 27,020
  • 6
  • 48
  • 102
  • Thank you! So "Workloads" are everything other than the stateless cluster? Also, pressing the duplicate button and changing network settings, will incoming traffic automatically be received on to the new cluster? – NorwegianClassic May 02 '22 at 14:40
  • No you have to create ingress and all if you are using it like Nginx or GCe ingress, you can clone your your resources (pvc, pv, ingress using) velero and migrate – Harsh Manvar May 02 '22 at 16:51