Migration of GKE from Default to Shared VPC and Public to Private GKE CLuster

10/9/2020

Few queries on GKE

  • We have few GKE CLusters running on Default VPC. Can we migrate these clusters to use SharedVPC or atleast Custom VPC? It seems existing clusters with default VPC mode cannot be changed to SharedVPC model as per GCP documentation but can we convert to Custom VPC from default VPC
  • How to migrate from Custom VPC to Shared VPC? Is it creating a new Cluster from existing Cluster and select SharedVPC in networking section for new cluster and then copy the Kubernetes resources to new Cluster?
  • Also looks like we cannot convert public GKE Cluster to private mode. Does this too requires creation of new Cluster to migrate from Public to Private GKE Cluster?
-- Zama Ques
google-cloud-platform
google-kubernetes-engine
kubernetes
private

1 Answer

10/10/2020

Unfortunatelly you cannot change any of those settings on the existing GKE cluster. You can clone the existing one by using DUPLICATE tab in cluster details:

enter image description here

During new cluster creation you can change it from Public to Private in Cluster -> Networking section:

enter image description here

After choosing it you'll need to correct fields that are marked in red:

enter image description here

You can also choose different VPC network.

When it comes to migrating a workload this is separate story. You can choose the approach which is most suitable for you, ranging from manually exporting all your yaml manifests (pretty tedious and not very convenient process I would say) to using dedicated tools like velero.

-- mario
Source: StackOverflow