diff --git a/README.md b/README.md index 134401c..3939766 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,18 @@ helm uninstall argo1 ```bash cd argo1 bash install-crds.sh +helm install --dependency-update argo1 . +kubectl apply -f ../secrets +argocd --core app sync argo1-secrets +argocd --core app sync argo1 +``` +### DUMP OF AN UNINSTALL + +```bash +cd argo1 +argocd --core app set argo1 --helm-set sealed-secrets.enabled=false --helm-set secrets.enabled=false +helm uninstall argo1 +``` [argo-crds]: https://argo-cd.readthedocs.io/en/stable/operator-manual/installation/ diff --git a/argo1/deploy.sh b/argo1/deploy.sh index ac91b85..5b269ad 100644 --- a/argo1/deploy.sh +++ b/argo1/deploy.sh @@ -7,14 +7,18 @@ ORIGNS="$(kubectl config view --minify -o jsonpath='{..namespace}')" ( set -e + + 1>&2 echo "creating namespace if it doesn't exist" jq -n --args '{"apiVersion":"v1","kind":"Namespace","metadata":{"name": $ARGS.positional[0]}}' "$TARGETNS" | kubectl apply -f - [ x"$TARGETNS" != x"$ORIGNS" ] && kubectl config set-context --current --namespace $TARGETNS - helm upgrade -i --create-namespace -n $TARGETNS argo1 argo/argo-cd -f values.yaml - kubectl wait -n $TARGETNS deploy/argocd-server --for=condition=available - #kubectl apply -f application.yaml - # - argocd --core app sync argocd + bash install-crds.sh + helm install -n "$TARGETNS" --dependency-update argo1 . + kubectl apply -f ../secrets + kubectl wait -n $TARGETNS deploy/argo1-argocd-server --for=condition=available + argocd --core app sync argo1-sealed-secrets + argocd --core app sync argo1-secrets + argocd --core app sync argo1 ) [ x"$TARGETNS" != x"$ORIGNS" ] && kubectl config set-context --current --namespace "$ORIGNS" diff --git a/argo1/templates/secrets.yaml b/argo1/templates/secrets.yaml index 5fe6cb6..f36a84b 100644 --- a/argo1/templates/secrets.yaml +++ b/argo1/templates/secrets.yaml @@ -4,8 +4,8 @@ kind: Application metadata: name: {{ .Release.Name }}-secrets namespace: argocd - finalizers: - - resources-finalizer.argocd.argoproj.io + #finalizers: + #- resources-finalizer.argocd.argoproj.io spec: project: default source: diff --git a/argo1/uninstall.sh b/argo1/uninstall.sh new file mode 100644 index 0000000..1300c17 --- /dev/null +++ b/argo1/uninstall.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +cd "$(dirname "$0")" + +TARGETNS="argocd" +ORIGNS="$(kubectl config view --minify -o jsonpath='{..namespace}')" + +( + set -e + + [ x"$TARGETNS" != x"$ORIGNS" ] && kubectl config set-context --current --namespace $TARGETNS + argocd --core app set argo1 --helm-set sealed-secrets.enabled=false --helm-set secrets.enabled=false + argocd --core app sync argo1 || argocd --core app wait --sync argo1 + helm uninstall -n "$TARGETNS" argo1 + bash delete-crds.sh +) + +[ x"$TARGETNS" != x"$ORIGNS" ] && kubectl config set-context --current --namespace "$ORIGNS"