This commit is contained in:
James Andariese 2023-04-23 20:34:24 -05:00
parent b656b8bd86
commit 752698ae95
4 changed files with 41 additions and 7 deletions

View File

@ -81,6 +81,18 @@ helm uninstall argo1
```bash ```bash
cd argo1 cd argo1
bash install-crds.sh 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/ [argo-crds]: https://argo-cd.readthedocs.io/en/stable/operator-manual/installation/

View File

@ -7,14 +7,18 @@ ORIGNS="$(kubectl config view --minify -o jsonpath='{..namespace}')"
( (
set -e 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 - 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 [ 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 bash install-crds.sh
kubectl wait -n $TARGETNS deploy/argocd-server --for=condition=available helm install -n "$TARGETNS" --dependency-update argo1 .
#kubectl apply -f application.yaml kubectl apply -f ../secrets
# kubectl wait -n $TARGETNS deploy/argo1-argocd-server --for=condition=available
argocd --core app sync argocd 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" [ x"$TARGETNS" != x"$ORIGNS" ] && kubectl config set-context --current --namespace "$ORIGNS"

View File

@ -4,8 +4,8 @@ kind: Application
metadata: metadata:
name: {{ .Release.Name }}-secrets name: {{ .Release.Name }}-secrets
namespace: argocd namespace: argocd
finalizers: #finalizers:
- resources-finalizer.argocd.argoproj.io #- resources-finalizer.argocd.argoproj.io
spec: spec:
project: default project: default
source: source:

18
argo1/uninstall.sh Normal file
View File

@ -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"