Skip to content

Migrate from applicationset to applications

New version METIS use ArgoCD Applications instead of ApplicationSet. In order to migrate old platform to new METIS version you need to:

  • stopping the applicationset controller, but this is dangerous in case of restart
  • patching applications to remove it owner reference
  • removing the applicationset

You can do this with theses commands:

# Stop applicationset controller
kubectl scale deploy -n argocd argocd-applicationset-controller --replicas 0

# Avoid automated sync
kubectl patch application -n argocd $(kubectl -n argocd get applications | awk '{print $1}')  --type='json' -p='[{"op": "remove", "path": "/spec/syncPolicy/automated"}]'
# Remove reference to applicationset
kubectl patch application -n argocd $(kubectl -n argocd get applications | awk '{print $1}')  --type='json' -p='[{"op": "remove", "path": "/metadata/ownerReferences"}]'
# Remove usage of AVP
kubectl patch application -n argocd $(kubectl -n argocd get applications | awk '{print $1}')  --type='json' -p='[{"op": "remove", "path": "/spec/source/plugin"}]'

# Apply new applications
kubectl apply -f <path-to-application.yaml>

# Remove applicationsets (with Web-UI or CLI)
kubectl -n argo delete $(kubectl -n argocd get applicationsets)