How can i export openshift native resource defination to yaml file, like Project/DeploymentConfig/BuildConfig

6/11/2021

I want export openshift resource defination like CRD YAML file, which import to k8s api server.

oc get crd project.openshift.io -o yaml > project_crd.yaml

kubectl apply -f project_crd.yaml

-- chestar
kubernetes
openshift

1 Answer

6/14/2021

You need to specify output format:

oc get crd $WHATEVER -o yaml > savedcrd.yaml

-- dbaker
Source: StackOverflow