From 2cb526df8ab575e798e58e1120a4a54314fefc06 Mon Sep 17 00:00:00 2001 From: Ari Sosnovsky Date: Tue, 21 Feb 2023 06:50:56 +0000 Subject: [PATCH] clean up --- bin/install-argo.sh | 5 ++++- bin/upgrade-argo.sh | 3 ++- k8s/argocd/templates/applicationset.yaml | 4 +++- k8s/argocd/templates/projects.yaml | 2 ++ k8s/argocd/templates/self-app.yaml | 6 +++++- 5 files changed, 16 insertions(+), 4 deletions(-) diff --git a/bin/install-argo.sh b/bin/install-argo.sh index 014b9f9..e38331b 100755 --- a/bin/install-argo.sh +++ b/bin/install-argo.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -e pushd k8s/argocd @@ -11,4 +12,6 @@ helm install argocd k8s/argocd \ --create-namespace \ --set selfapp.sshkey="$(cat ~/.ssh/id_rsa)" -watch -n1 "kubectl -n argocd get all" \ No newline at end of file +watch -n1 "kubectl -n argocd get all" + +argocd admin initial-password \ No newline at end of file diff --git a/bin/upgrade-argo.sh b/bin/upgrade-argo.sh index 12363fd..17ac8fc 100755 --- a/bin/upgrade-argo.sh +++ b/bin/upgrade-argo.sh @@ -3,4 +3,5 @@ helm upgrade argocd k8s/argocd \ --namespace argocd \ --create-namespace \ - --set selfapp.sshkey="$(cat ~/.ssh/id_rsa)" \ No newline at end of file + --set selfapp.sshkey="$(cat ~/.ssh/id_rsa)" \ + --set selfapp.enabled="true" \ No newline at end of file diff --git a/k8s/argocd/templates/applicationset.yaml b/k8s/argocd/templates/applicationset.yaml index 167c4c3..a1f6a84 100644 --- a/k8s/argocd/templates/applicationset.yaml +++ b/k8s/argocd/templates/applicationset.yaml @@ -1,3 +1,4 @@ +{{- if .Values.selfapp.enabled -}} --- apiVersion: argoproj.io/v1alpha1 kind: ApplicationSet @@ -25,4 +26,5 @@ spec: namespace: '{{ `{{path.basename}}` }}' syncPolicy: syncOptions: - - CreateNamespace=true \ No newline at end of file + - CreateNamespace=true +{{- end -}} \ No newline at end of file diff --git a/k8s/argocd/templates/projects.yaml b/k8s/argocd/templates/projects.yaml index ca78e36..c493b0d 100644 --- a/k8s/argocd/templates/projects.yaml +++ b/k8s/argocd/templates/projects.yaml @@ -1,3 +1,4 @@ +{{- if .Values.selfapp.enabled -}} --- apiVersion: argoproj.io/v1alpha1 kind: AppProject @@ -12,3 +13,4 @@ spec: - '*' destinations: - server: https://kubernetes.default.svc +{{- end -}} \ No newline at end of file diff --git a/k8s/argocd/templates/self-app.yaml b/k8s/argocd/templates/self-app.yaml index e2f3626..14b5297 100644 --- a/k8s/argocd/templates/self-app.yaml +++ b/k8s/argocd/templates/self-app.yaml @@ -1,3 +1,4 @@ +{{- if .Values.selfapp.enabled -}} --- apiVersion: argoproj.io/v1alpha1 kind: Application @@ -12,6 +13,8 @@ spec: path: k8s/argocd helm: parameters: + - name: "selfapp.enabled" + value: true - name: "selfapp.sshkey" value: {{ .Values.selfapp.sshkey | quote }} destination: @@ -21,4 +24,5 @@ spec: # automated: # prune: false # selfHeal: true - # allowEmpty: true \ No newline at end of file + # allowEmpty: true +{{- end -}} \ No newline at end of file