Home > Blockchain >  Migrating resourses from an openshift cluster to another
Migrating resourses from an openshift cluster to another

Time:01-25

I have an Openshift cluster and I want to move its resources to another cluster,

e.g. I have 40 Secrets, and 20 ConfigMaps, moving these secrets and config maps manually is mind-blowing.

What is the best approach?

CodePudding user response:

I would recommend trying out Monokle's Compare & Sync UI

You can read more about how this works in the docs.

CodePudding user response:

There might be easier ways, but here are the steps I'd do:

1 - Login to the first cluster:

oc login --token="your-token-for-first-server" --server="your-first-server"

2 - Export your resources:

oc get -o yaml cm > configmaps.yaml
oc get -o yaml secrets > secrets.yaml
...

There are also some default ConfigMaps and Secrets which you don't need to copy, you can erase them after making the files.

3 - Login to the second cluster:

oc login --token="your-token-for-second-server" --server="your-second-server"

If you forget this step, you may get an error that says resource already exists, but be careful not to forget this step.

4 - Load resources to the second cluster

oc create -f configmaps.yaml
oc create -f secrets.yaml
...
  • Related