From ba4d01a0d162f6335026286d9e47dd90ec412023 Mon Sep 17 00:00:00 2001 From: Ari Sosnovsky Date: Tue, 14 Mar 2023 21:52:23 +0000 Subject: [PATCH] using global everywhere --- bin/dryrun-argo.sh | 4 +- bin/install-argo.sh | 11 +++-- bin/upgrade-argo.sh | 9 ++-- k8s/argocd/templates/app-self.yaml | 2 +- k8s/argocd/templates/appset-infra.yaml | 4 +- k8s/argocd/templates/ingress.yaml | 61 +++++++++++++++----------- k8s/argocd/values-dev.yaml | 2 +- 7 files changed, 56 insertions(+), 37 deletions(-) diff --git a/bin/dryrun-argo.sh b/bin/dryrun-argo.sh index e7d0634..8b3d03d 100755 --- a/bin/dryrun-argo.sh +++ b/bin/dryrun-argo.sh @@ -6,5 +6,7 @@ helm template argocd k8s/argocd \ --namespace argocd \ --create-namespace \ --values k8s/argocd/values.yaml \ + --values k8s/argocd/values-dev.yaml \ --set selfapp.enabled="true" \ - --set selfapp.sshkey="$(cat ~/.ssh/id_rsa)" > .tmp/argocd.yaml \ No newline at end of file + --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 0edda83..9aa0071 100755 --- a/bin/install-argo.sh +++ b/bin/install-argo.sh @@ -5,14 +5,17 @@ pushd k8s/argocd helm dependency update +DEPLOYMENT=dev + popd helm install argocd k8s/argocd \ --namespace argocd \ --create-namespace \ --values k8s/argocd/values.yaml \ - --set selfapp.sshkey="$(cat ~/.ssh/id_rsa)" \ - --set selfapp.deployment=dev + --values k8s/argocd/values-$DEPLOYMENT.yaml \ + --set selfapp.enabled="true" \ + --set selfapp.sshkey="$(cat ~/.ssh/id_rsa)" watch -n1 "kubectl -n argocd get all" @@ -24,6 +27,6 @@ helm upgrade argocd k8s/argocd \ --namespace argocd \ --create-namespace \ --values k8s/argocd/values.yaml \ + --values k8s/argocd/values-$DEPLOYMENT.yaml \ --set selfapp.enabled="true" \ - --set selfapp.deployment=dev \ - --set selfapp.sshkey="$(cat ~/.ssh/id_rsa)" + --set selfapp.sshkey="$(cat ~/.ssh/id_rsa)" diff --git a/bin/upgrade-argo.sh b/bin/upgrade-argo.sh index f285f8b..7516357 100755 --- a/bin/upgrade-argo.sh +++ b/bin/upgrade-argo.sh @@ -1,9 +1,12 @@ #!/bin/bash +DEPLOYMENT=dev + helm upgrade argocd k8s/argocd \ + --debug \ --namespace argocd \ --create-namespace \ --values k8s/argocd/values.yaml \ - --set selfapp.deployment=dev \ - --set selfapp.sshkey="$(cat ~/.ssh/id_rsa)" \ - --set selfapp.enabled="true" \ No newline at end of file + --values k8s/argocd/values-$DEPLOYMENT.yaml \ + --set selfapp.enabled="true" \ + --set selfapp.sshkey="$(cat ~/.ssh/id_rsa)" \ No newline at end of file diff --git a/k8s/argocd/templates/app-self.yaml b/k8s/argocd/templates/app-self.yaml index a17d0b7..dd49212 100644 --- a/k8s/argocd/templates/app-self.yaml +++ b/k8s/argocd/templates/app-self.yaml @@ -14,7 +14,7 @@ spec: helm: valueFiles: - values.yaml - - values-{{ .Values.selfapp.deployment }}.yaml + - values-{{ .Values.global.deployment }}.yaml parameters: - name: "selfapp.enabled" value: "true" diff --git a/k8s/argocd/templates/appset-infra.yaml b/k8s/argocd/templates/appset-infra.yaml index 4a0e6a0..c7f33d6 100644 --- a/k8s/argocd/templates/appset-infra.yaml +++ b/k8s/argocd/templates/appset-infra.yaml @@ -22,8 +22,8 @@ spec: path: '{{ `{{path}}` }}' helm: values: |- - global: - domain: "{{ .Values.selfapp.domain }}" + global: + {{- .Values.global | toYaml | nindent 28 }} valueFiles: - values.yaml - values-{{ .Values.selfapp.deployment }}.yaml diff --git a/k8s/argocd/templates/ingress.yaml b/k8s/argocd/templates/ingress.yaml index 42495b1..fff7243 100644 --- a/k8s/argocd/templates/ingress.yaml +++ b/k8s/argocd/templates/ingress.yaml @@ -1,25 +1,36 @@ -# --- -# apiVersion: traefik.containo.us/v1alpha1 -# kind: IngressRoute -# metadata: -# name: argocd-server -# namespace: argocd -# spec: -# entryPoints: -# - websecure -# routes: -# - kind: Rule -# match: Host(`argocd.{{ .Values.selfapp.domain }}`) -# priority: 10 -# services: -# - name: argocd-server -# port: 80 -# - kind: Rule -# match: Host(`argocd.{{ .Values.selfapp.domain }}`) && Headers(`Content-Type`, `application/grpc`) -# priority: 11 -# services: -# - name: argocd-server -# port: 80 -# scheme: h2c -# tls: -# certResolver: default \ No newline at end of file +--- +apiVersion: v1 +items: + - apiVersion: networking.k8s.io/v1 + kind: Ingress + metadata: + name: argocd-server-grpc + namespace: argocd + spec: + rules: + - http: + paths: + - backend: + service: + name: argocd-server + port: + number: 80 + path: / + pathType: Prefix +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: argocd-server + namespace: argocd +spec: + rules: + - http: + paths: + - backend: + service: + name: argocd-server + port: + number: 443 + path: /argocd + pathType: Prefix diff --git a/k8s/argocd/values-dev.yaml b/k8s/argocd/values-dev.yaml index edebe21..57b3765 100644 --- a/k8s/argocd/values-dev.yaml +++ b/k8s/argocd/values-dev.yaml @@ -1,3 +1,3 @@ -selfapp: +global: deployment: dev domain: "me.local"