Migrate from component version v0.1.0 to v1.x
Due to the nature of the fix for #24, migrating to the fixed version of the component requires a couple manual steps.
This document guides you through the migration.
While we give oc commands to manage the ArgoCD apps, you can also perform those steps through the ArgoCD UI, if you prefer.
|
Prerequisites
-
oc
CLI available and logged into the cluster as a user which can impersonatecluster-admin
-
argocd
CLI available, see ArgoCD CLI installation documentation
Procedure
-
Setup port-forward to ArgoCD and login to ArgoCD with the CLI
oc --as=cluster-admin -n syn port-forward svc/argocd-server 8080:80 & sleep 1 argocd login --plaintext --username=admin --password=$(oc --as=cluster-admin -n syn get secret steward -ojsonpath='{.data.token}' |base64 -d) localhost:8080
-
Disable auto sync for the ArgoCD apps
root
andopenshift4-monitoring
With
argocd
:argocd app set --sync-option=none root argocd app set --sync-option=none openshift4-monitoring
With
oc
:oc --as=cluster-admin -n syn patch apps root --type=json \ -p '[{"op":"replace", "path":"/spec/syncPolicy", "value": {}}]' oc --as=cluster-admin -n syn patch apps openshift4-monitoring --type=json \ -p '[{"op":"replace", "path":"/spec/syncPolicy", "value": {}}]'
-
Remove ArgoCD managed-by label from the
openshift-monitoring
namespace objectoc --as=cluster-admin label ns openshift-monitoring argocd.argoproj.io/instance-
-
Update cluster to use openshift4-monitoring v1.0.0. Add the following configuration in the cluster config:
inventory/classes/<tenant-id>/<cluster-id>.ymlparameters: components: openshift4_monitoring: version: v1.0.0
-
Compile and push catalog
commodore catalog compile --push -i <cluster-id>
-
Trigger a hard refresh of
openshift4-monitoring
appargocd app get --hard-refresh openshift4-monitoring
You can trigger a hard refresh via the ArgoCD UI instead of using the ArgoCD CLI command. -
Sync
root
appWith
argocd
:argocd app sync root
With
oc
:oc --as=cluster-admin -n syn patch apps root --type=json \ -p '[{ "op":"replace", "path":"/spec/syncPolicy", "value": {"automated": {"prune": true, "selfHeal": true}} }]'
With oc
we don’t directly trigger a sync, but instead re-enable auto sync in the app object. -
Terminate port-forward to ArgoCD
kill %1