This commit is contained in:
James Andariese 2023-04-23 20:07:11 -05:00
parent f67fd0e1e8
commit b656b8bd86
4 changed files with 64 additions and 5 deletions

View File

@ -76,5 +76,11 @@ argocd app set argo1 --helm-set secrets.enabled=false --helm-set sealed-secrets.
helm uninstall argo1
```
#### DUMP OF AN INSTALL
```bash
cd argo1
bash install-crds.sh
[argo-crds]: https://argo-cd.readthedocs.io/en/stable/operator-manual/installation/

54
argo1/delete-crds.sh Normal file
View File

@ -0,0 +1,54 @@
#!/bin/bash
MAINDIR="$(dirname "$0")"
cd "$MAINDIR"
application_chart_info() {
F="$1"
yq -o json . "$F" | jq -r '
.spec.source
| (
@sh "CHART=\(.chart)",
@sh "VERSION=\(.targetRevision)",
@sh "REPO=\(.repoURL)"
)
'
}
dependency_chart_info() {
F="${1:-"$MAINDIR"/Chart.yaml}"
DEP="${2:-0}"
yq -o json . "$F" | jq -r --argjson d "$DEP" '
.dependencies[$d]
| (
@sh "CHART=\(.name)",
@sh "VERSION=\(.version)",
@sh "REPO=\(.repository)"
)
'
}
(
set -e
eval "$(dependency_chart_info)"
set -x
helm template argocd-crds --include-crds "$CHART" --repo "$REPO" --version "$VERSION" | yq 'select(.kind == "CustomResourceDefinition")' | kubectl delete -f -
)
RC=$?
if [ $RC -ne 0 ];then
1>&2 echo "error deleting ArgoCD CRDs"
fi
(
set -e
eval "$(application_chart_info templates/sealed-secrets.yaml)"
set -x
helm template sealed-secrets-crds --include-crds "$CHART" --repo "$REPO" --version "$VERSION" | yq 'select(.kind == "CustomResourceDefinition")' | kubectl delete -f -
)
RC=$?
if [ $RC -ne 0 ];then
1>&2 echo "error deleting Sealed Secrets CRDs"
fi

View File

@ -42,8 +42,6 @@ if [ $RC -ne 0 ];then
exit $RC
fi
for f in templates/*.yaml
(
set -e
eval "$(application_chart_info templates/sealed-secrets.yaml)"

View File

@ -1,11 +1,12 @@
{{ if (index .Values "sealed-secrets").enabled -}}
# {{ if (index .Values "sealed-secrets").enabled -}}
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: "{{ .Release.Name }}-sealed-secrets"
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
- resources-finalizer.argocd.argoproj.io
spec:
project: default
source:
@ -29,4 +30,4 @@ spec:
duration: 5s
factor: 2
maxDuration: 3m0s
{{- end }}
# {{- end }}