diff --git a/bin/dryrun-argo.sh b/bin/dryrun-argo.sh index 4879fba..7193aa7 100755 --- a/bin/dryrun-argo.sh +++ b/bin/dryrun-argo.sh @@ -2,7 +2,7 @@ mkdir -p .tmp -helm template argocd k8s/infra/argocd \ +helm template argocd k8s/argocd \ --namespace argocd \ --create-namespace \ --set selfapp.sshkey="$(cat ~/.ssh/id_rsa)" > .tmp/argocd.yaml \ No newline at end of file diff --git a/bin/install-argo.sh b/bin/install-argo.sh index 69d517d..014b9f9 100755 --- a/bin/install-argo.sh +++ b/bin/install-argo.sh @@ -1,6 +1,12 @@ #!/bin/bash -helm install argocd k8s/infra/argocd \ +pushd k8s/argocd + +helm dependency build + +popd + +helm install argocd k8s/argocd \ --namespace argocd \ --create-namespace \ --set selfapp.sshkey="$(cat ~/.ssh/id_rsa)" diff --git a/bin/upgrade-argo.sh b/bin/upgrade-argo.sh index e246dce..12363fd 100755 --- a/bin/upgrade-argo.sh +++ b/bin/upgrade-argo.sh @@ -1,6 +1,6 @@ #!/bin/bash -helm upgrade argocd k8s/infra/argocd \ +helm upgrade argocd k8s/argocd \ --namespace argocd \ --create-namespace \ --set selfapp.sshkey="$(cat ~/.ssh/id_rsa)" \ No newline at end of file diff --git a/k8s/infra/argocd/.gitkeep b/k8s/argocd/.gitkeep similarity index 100% rename from k8s/infra/argocd/.gitkeep rename to k8s/argocd/.gitkeep diff --git a/k8s/infra/argocd/.helmignore b/k8s/argocd/.helmignore similarity index 100% rename from k8s/infra/argocd/.helmignore rename to k8s/argocd/.helmignore diff --git a/k8s/infra/argocd/Chart.lock b/k8s/argocd/Chart.lock similarity index 100% rename from k8s/infra/argocd/Chart.lock rename to k8s/argocd/Chart.lock diff --git a/k8s/infra/argocd/Chart.yaml b/k8s/argocd/Chart.yaml similarity index 100% rename from k8s/infra/argocd/Chart.yaml rename to k8s/argocd/Chart.yaml diff --git a/k8s/infra/argocd/charts/argo-cd-5.22.1.tgz b/k8s/argocd/charts/argo-cd-5.22.1.tgz similarity index 100% rename from k8s/infra/argocd/charts/argo-cd-5.22.1.tgz rename to k8s/argocd/charts/argo-cd-5.22.1.tgz diff --git a/k8s/argocd/templates/applicationset.yaml b/k8s/argocd/templates/applicationset.yaml new file mode 100644 index 0000000..167c4c3 --- /dev/null +++ b/k8s/argocd/templates/applicationset.yaml @@ -0,0 +1,28 @@ +--- +apiVersion: argoproj.io/v1alpha1 +kind: ApplicationSet +metadata: + name: "infra" + namespace: "{{ .Release.Namespace }}" +spec: + generators: + - git: + repoURL: "git@github.com:{{ .Values.selfapp.repo }}.git" + revision: "{{ .Values.selfapp.commit }}" + directories: + - path: k8s/infra/* + template: + metadata: + name: '{{ `{{path.basename}}` }}' + spec: + project: "infra" + source: + repoURL: "git@github.com:{{ .Values.selfapp.repo }}.git" + targetRevision: "{{ .Values.selfapp.commit }}" + path: '{{ `{{path}}` }}' + destination: + server: https://kubernetes.default.svc + namespace: '{{ `{{path.basename}}` }}' + syncPolicy: + syncOptions: + - CreateNamespace=true \ No newline at end of file diff --git a/k8s/infra/argocd/templates/ingress.yaml b/k8s/argocd/templates/ingress.yaml similarity index 100% rename from k8s/infra/argocd/templates/ingress.yaml rename to k8s/argocd/templates/ingress.yaml diff --git a/k8s/infra/argocd/templates/projects.yaml b/k8s/argocd/templates/projects.yaml similarity index 100% rename from k8s/infra/argocd/templates/projects.yaml rename to k8s/argocd/templates/projects.yaml diff --git a/k8s/infra/argocd/templates/repo.yaml b/k8s/argocd/templates/repo.yaml similarity index 100% rename from k8s/infra/argocd/templates/repo.yaml rename to k8s/argocd/templates/repo.yaml diff --git a/k8s/argocd/templates/self-app.yaml b/k8s/argocd/templates/self-app.yaml new file mode 100644 index 0000000..e2f3626 --- /dev/null +++ b/k8s/argocd/templates/self-app.yaml @@ -0,0 +1,24 @@ +--- +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: "{{ .Release.Name }}" + namespace: "{{ .Release.Namespace }}" +spec: + project: default + source: + repoURL: "git@github.com:{{ .Values.selfapp.repo }}.git" + targetRevision: "{{ .Values.selfapp.commit }}" + path: k8s/argocd + helm: + parameters: + - name: "selfapp.sshkey" + value: {{ .Values.selfapp.sshkey | quote }} + destination: + server: https://kubernetes.default.svc + namespace: "{{ .Release.Namespace }}" + # syncPolicy: + # automated: + # prune: false + # selfHeal: true + # allowEmpty: true \ No newline at end of file diff --git a/k8s/infra/argocd/values.yaml b/k8s/argocd/values.yaml similarity index 100% rename from k8s/infra/argocd/values.yaml rename to k8s/argocd/values.yaml diff --git a/k8s/infra/argocd/templates/applicationset.yaml b/k8s/infra/argocd/templates/applicationset.yaml deleted file mode 100644 index 6f0831b..0000000 --- a/k8s/infra/argocd/templates/applicationset.yaml +++ /dev/null @@ -1,56 +0,0 @@ -# --- -# apiVersion: argoproj.io/v1alpha1 -# kind: Application -# metadata: -# name: "{{ .Release.Name }}" -# namespace: "{{ .Release.Namespace }}" -# spec: -# project: default -# source: -# repoURL: "git@github.com:{{ .Values.selfapp.repo }}.git" -# targetRevision: "{{ .Values.selfapp.commit }}" -# path: k8s/infra/argocd -# helm: -# parameters: -# - name: "selfapp.sshkey" -# value: {{ .Values.selfapp.sshkey | quote }} -# destination: -# server: https://kubernetes.default.svc -# namespace: "{{ .Release.Namespace }}" -# # syncPolicy: -# # automated: -# # prune: false -# # selfHeal: true -# # allowEmpty: true ---- -apiVersion: argoproj.io/v1alpha1 -kind: ApplicationSet -metadata: - name: "infra" - namespace: "{{ .Release.Namespace }}" -spec: - generators: - - git: - repoURL: "git@github.com:{{ .Values.selfapp.repo }}.git" - revision: "{{ .Values.selfapp.commit }}" - directories: - - path: k8s/infra/* - template: - metadata: - name: '{{ `{{path.basename}}` }}' - spec: - project: "infra" - source: - repoURL: "git@github.com:{{ .Values.selfapp.repo }}.git" - targetRevision: "{{ .Values.selfapp.commit }}" - path: '{{ `{{path}}` }}' - destination: - server: https://kubernetes.default.svc - namespace: '{{ `{{path.basename}}` }}' - helm: - parameters: - - name: "selfapp.sshkey" - value: {{ .Values.selfapp.sshkey | quote }} - syncPolicy: - syncOptions: - - CreateNamespace=true \ No newline at end of file