|
3 | 3 | #
|
4 | 4 | # Welcome to the OwnNamespace install mode demo
|
5 | 5 | #
|
6 |
| -trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT |
| 6 | +set -e |
| 7 | +trap 'echo "Demo ran into error"; trap - SIGTERM && kill -- -$$; exit 1' ERR SIGINT SIGTERM EXIT |
| 8 | + |
| 9 | +# install experimental CRDs with config field support |
| 10 | +kubectl apply -f "$(dirname "${BASH_SOURCE[0]}")/../../manifests/experimental.yaml" |
| 11 | + |
| 12 | +# wait for experimental CRDs to be available |
| 13 | +kubectl wait --for condition=established --timeout=60s crd/clusterextensions.olm.operatorframework.io |
7 | 14 |
|
8 | 15 | # enable 'SingleOwnNamespaceInstallSupport' feature gate
|
9 | 16 | kubectl patch deployment -n olmv1-system operator-controller-controller-manager --type='json' -p='[{"op": "add", "path": "/spec/template/spec/containers/0/args/-", "value": "--feature-gates=SingleOwnNamespaceInstallSupport=true"}]'
|
@@ -41,3 +48,27 @@ kubectl get deployments -n argocd-system argocd-operator-controller-manager -o j
|
41 | 48 | # check service account for role binding is the same as controller service-account
|
42 | 49 | rolebinding=$(kubectl get rolebindings -n argocd-system -o name | grep 'argocd-operator' | head -n 1)
|
43 | 50 | kubectl get -n argocd-system $rolebinding -o jsonpath='{.subjects}' | jq .[0]
|
| 51 | + |
| 52 | +echo "Demo completed successfully!" |
| 53 | + |
| 54 | +# cleanup resources |
| 55 | +echo "Cleaning up demo resources..." |
| 56 | +kubectl delete clusterextension argocd-operator --ignore-not-found=true |
| 57 | +kubectl delete namespace argocd-system --ignore-not-found=true |
| 58 | +kubectl delete clusterrolebinding argocd-installer-crb --ignore-not-found=true |
| 59 | + |
| 60 | +# remove feature gate from deployment |
| 61 | +echo "Removing feature gate from operator-controller..." |
| 62 | +kubectl patch deployment -n olmv1-system operator-controller-controller-manager --type='json' -p='[{"op": "remove", "path": "/spec/template/spec/containers/0/args", "value": "--feature-gates=SingleOwnNamespaceInstallSupport=true"}]' || true |
| 63 | + |
| 64 | +# restore standard CRDs |
| 65 | +echo "Restoring standard CRDs..." |
| 66 | +kubectl apply -f "$(dirname "${BASH_SOURCE[0]}")/../../manifests/base.yaml" |
| 67 | + |
| 68 | +# wait for standard CRDs to be available |
| 69 | +kubectl wait --for condition=established --timeout=60s crd/clusterextensions.olm.operatorframework.io |
| 70 | + |
| 71 | +# wait for operator-controller to become available with standard config |
| 72 | +kubectl rollout status -n olmv1-system deployment/operator-controller-controller-manager |
| 73 | + |
| 74 | +echo "Demo cleanup completed!" |
0 commit comments