Manage Operator
This guide is for both the Armory Operator and the Spinnaker Operator. Armory Enterprise and Spinnaker configuration is the same except for features only in Armory Enterprise. Those features are marked .
Upgrade the Operator
Do not manually change Docker image tags in your existing manifest files. Operator computes the compatible Halyard version, so manually updating image tags is an unsupported upgrade method and may cause issues.
Use the kubectl replace
command to replace your Operator deployment. See the kubectl replace
docs for an explanation of this command.
-
Download the Operator version you want to upgrade to:
In the following command, replace
<version>
with the specific version or “latest” for the most recent version.bash -c 'curl -L https://github.com/armory-io/spinnaker-operator/releases/<version>/download/manifests.tgz | tar -xz'
-
Update CRDs across the cluster:
kubectl replace -f deploy/crds/
-
Update the Operator:
kubectl -n spinnaker-operator replace -f deploy/operator/cluster
Uninstall the Operator
Uninstalling the Operator involves deleting its deployment and SpinnakerService
CRD. When you delete the Operator CRD, Kubernetes deletes any installation created by Operator. This occurs because the CRD is set as the owner of the resources, so they get garbage collected.
There are two ways in which you can remove this ownership relationship so that Armory Enterprise is not deleted when deleting the Operator: replace Operator with Halyard or removing Operator ownership of resources.
Replace Operator with Halyard
First, export 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. For example, an entry namedprofiles__rosco__packer__example-packer-config.json
results in the fileprofiles/rosco/packer/example-packer-config.json
.
When finished, you have the following directory tree:
config
default/
profiles/
service-settings/
After that, move these files to your Halyard home directory and deploy Armory Enterprise with the hal deploy apply
command.
Finally, delete Operator and its CRDs from the Kubernetes cluster.
kubectl delete -n <namespace> -f deploy/operator/<installation type>
kubectl delete -f deploy/crds/
Remove Operator ownership of Armory Enterprise resources
Run the following script to remove ownership of Armory resources, where NAMESPACE
is the namespace where Armory Enterprise is installed:
#! /usr/bin/env bash
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
After the script completes, delete the Operator and its CRDs from the Kubernetes cluster:
kubectl delete -n <namespace> -f deploy/operator/<installation type>
kubectl delete -f deploy/crds/
Help resources
- Armory Operator and Armory Enterprise: contact Armory Support or use the Spinnaker Slack
#armory
channel. - Spinnaker Operator and Spinnaker: Spinnaker Slack
#kubernetes-operator
channel.
Feedback
Was this page helpful?
Thank you for letting us know!
Sorry to hear that. Please tell us how we can improve.
Last modified August 11, 2021: (e1d08ea)