Skip to content

Commit 53b0f1a

Browse files
committed
update docs and demo to use new config spec
1 parent c5c08b6 commit 53b0f1a

File tree

5 files changed

+68
-10
lines changed

5 files changed

+68
-10
lines changed

docs/draft/howto/single-ownnamespace-install.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@ apiVersion: olm.operatorframework.io/v1
9191
kind: ClusterExtension
9292
metadata:
9393
name: argocd
94-
annotations:
95-
olm.operatorframework.io/watch-namespace: argocd
9694
spec:
9795
namespace: argocd
9896
serviceAccount:

hack/demo/own-namespace-demo-script.sh

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@
33
#
44
# Welcome to the OwnNamespace install mode demo
55
#
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
714

815
# enable 'SingleOwnNamespaceInstallSupport' feature gate
916
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
4148
# check service account for role binding is the same as controller service-account
4249
rolebinding=$(kubectl get rolebindings -n argocd-system -o name | grep 'argocd-operator' | head -n 1)
4350
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!"

hack/demo/resources/own-namespace-demo.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ apiVersion: olm.operatorframework.io/v1
22
kind: ClusterExtension
33
metadata:
44
name: argocd-operator
5-
annotations:
6-
# watch namespace is the same as intall namespace
7-
olm.operatorframework.io/watch-namespace: argocd-system
85
spec:
96
namespace: argocd-system
107
serviceAccount:

hack/demo/resources/single-namespace-demo.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@ apiVersion: olm.operatorframework.io/v1
22
kind: ClusterExtension
33
metadata:
44
name: argocd-operator
5-
annotations:
6-
# watch-namespace is different from install namespace
7-
olm.operatorframework.io/watch-namespace: argocd
85
spec:
96
namespace: argocd-system
107
serviceAccount:
118
name: argocd-installer
9+
config:
10+
configType: Inline
11+
inline:
12+
watchNamespace: argocd
1213
source:
1314
sourceType: Catalog
1415
catalog:

hack/demo/single-own-namespace-demo-script.sh renamed to hack/demo/single-namespace-demo-script.sh

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@
33
#
44
# Welcome to the SingleNamespace install mode demo
55
#
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
714

815
# enable 'SingleOwnNamespaceInstallSupport' feature gate
916
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"}]'
@@ -44,3 +51,27 @@ kubectl get deployments -n argocd-system argocd-operator-controller-manager -o j
4451
# check service account for role binding is the controller deployment service account
4552
rolebinding=$(kubectl get rolebindings -n argocd -o name | grep 'argocd-operator' | head -n 1)
4653
kubectl get -n argocd $rolebinding -o jsonpath='{.subjects}' | jq .[0]
54+
55+
echo "Demo completed successfully!"
56+
57+
# cleanup resources
58+
echo "Cleaning up demo resources..."
59+
kubectl delete clusterextension argocd-operator --ignore-not-found=true
60+
kubectl delete namespace argocd-system argocd --ignore-not-found=true
61+
kubectl delete clusterrolebinding argocd-installer-crb --ignore-not-found=true
62+
63+
# remove feature gate from deployment
64+
echo "Removing feature gate from operator-controller..."
65+
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
66+
67+
# restore standard CRDs
68+
echo "Restoring standard CRDs..."
69+
kubectl apply -f "$(dirname "${BASH_SOURCE[0]}")/../../manifests/base.yaml"
70+
71+
# wait for standard CRDs to be available
72+
kubectl wait --for condition=established --timeout=60s crd/clusterextensions.olm.operatorframework.io
73+
74+
# wait for operator-controller to become available with standard config
75+
kubectl rollout status -n olmv1-system deployment/operator-controller-controller-manager
76+
77+
echo "Demo cleanup completed!"

0 commit comments

Comments
 (0)