If Operator needs to be uninstalled or deleted, you can keep the Spinnaker deployments from being deleted in one of two ways: replacing Operator with Halyard or removing Operator ownership of Spinnaker resources.
First you need to export Spinnaker configuration settings to a format that Halyard understands:
- From the
SpinnakerService
manifest, copy the contents ofspec.spinnakerConfig.config
to its own file namedconfig
, and save it with the following structure:
currentDeployment: default
deploymentConfigurations:
- name: default
<<CONTENT HERE>>
- For each entry in
spec.spinnakerConfig.profiles
, copy it to its own file inside aprofiles
folder with a<entry-name>-local.yml
name. - For each entry in
spec.spinnakerConfig.service-settings
, copy it to its own file inside aservice-settings
folder with a<entry-name>.yml
name. - For each entry in
spec.spinnakerConfig.files
, copy it to its own file inside a directory structure following the name of the entry with double underscores (__) replaced by a path separator. Example: an entry namedprofiles__rosco__packer__example-packer-config.json
would produce the fileprofiles/rosco/packer/example-packer-config.json
.
At the end, you would have the following directory tree:
config
default/
profiles/
service-settings/
After that, you can put these files in your Halyard home directory and deploy Spinnaker running hal deploy apply
.
Finally you can delete the operator and their CRDs from the Kubernetes cluster.
$ kubectl delete -n <namespace> -f deploy/operator/<installation type>
$ kubectl delete -f deploy/crds/
You can execute the following script to remove ownership of Spinnaker resources, where NAMESPACE
is the namespace where Spinnaker is installed:
NAMESPACE=
for rtype in deployment service
do
for r in $(kubectl -n $NAMESPACE get $rtype --selector=app=spin -o jsonpath='{.items[*].metadata.name}')
do
kubectl -n $NAMESPACE patch $rtype $r --type json -p='[{"op": "remove", "path": "/metadata/ownerReferences"}]'
done
done
Finally you can delete the operator and their CRDs from the Kubernetes cluster.
$ kubectl delete -n <namespace> -f deploy/operator/<installation type>
$ kubectl delete -f deploy/crds/