From f1ef61d508e0036103c9799e97d3f7f3fd874ba6 Mon Sep 17 00:00:00 2001 From: Ari Sosnovsky Date: Thu, 17 Apr 2025 16:06:58 -0400 Subject: [PATCH] latest charts --- charts/apps/dummy/templates/dummy-pod.yaml | 2 +- charts/apps/dummy/values-dev.yaml | 0 charts/apps/dummy/values-prod.yaml | 0 .../apps/ingress/templates/clusterissuer.yaml | 106 ++++++++++++++++++ charts/apps/ingress/templates/dummy-pod.yaml | 38 ------- charts/apps/ingress/values-dev.yaml | 0 charts/apps/ingress/values-prod.yaml | 2 + charts/apps/ingress/values.yaml | 9 ++ .../templates/argocd-appset.yml | 9 +- charts/infrastructure/values.yaml | 6 +- 10 files changed, 127 insertions(+), 45 deletions(-) create mode 100644 charts/apps/dummy/values-dev.yaml create mode 100644 charts/apps/dummy/values-prod.yaml create mode 100644 charts/apps/ingress/templates/clusterissuer.yaml delete mode 100644 charts/apps/ingress/templates/dummy-pod.yaml create mode 100644 charts/apps/ingress/values-dev.yaml create mode 100644 charts/apps/ingress/values-prod.yaml diff --git a/charts/apps/dummy/templates/dummy-pod.yaml b/charts/apps/dummy/templates/dummy-pod.yaml index da58077..f6e2174 100644 --- a/charts/apps/dummy/templates/dummy-pod.yaml +++ b/charts/apps/dummy/templates/dummy-pod.yaml @@ -2,7 +2,7 @@ kind: Deployment apiVersion: apps/v1 metadata: - name: dummy-app-2 + name: dummy-app namespace: "{{ .Release.Namespace }}" spec: replicas: 1 diff --git a/charts/apps/dummy/values-dev.yaml b/charts/apps/dummy/values-dev.yaml new file mode 100644 index 0000000..e69de29 diff --git a/charts/apps/dummy/values-prod.yaml b/charts/apps/dummy/values-prod.yaml new file mode 100644 index 0000000..e69de29 diff --git a/charts/apps/ingress/templates/clusterissuer.yaml b/charts/apps/ingress/templates/clusterissuer.yaml new file mode 100644 index 0000000..d384e19 --- /dev/null +++ b/charts/apps/ingress/templates/clusterissuer.yaml @@ -0,0 +1,106 @@ +{{ if .Values.global.tls.enabled }} +--- +apiVersion: cert-manager.io/v1 +kind: ClusterIssuer +metadata: + name: {{ .Values.global.tls.issuer }} +spec: + acme: + server: {{ .Values.global.tls.acmeServer }} + skipTLSVerify: {{ .Values.global.tls.skipTLSVerify }} + email: {{ .Values.global.email }} + privateKeySecretRef: + name: {{ .Values.global.tls.issuer }} + solvers: + - http01: + ingress: + class: traefik + +{{ if .Values.cloudflare.enabled }} +--- +apiVersion: cert-manager.io/v1 +kind: Issuer +metadata: + name: cloudflare +spec: + acme: + server: {{ .Values.global.tls.acmeServer }} + skipTLSVerify: {{ .Values.global.tls.skipTLSVerify }} + email: {{ .Values.global.email }} + privateKeySecretRef: + name: cloudflare + solvers: + - dns01: + cloudflare: + apiTokenSecretRef: + name: {{ .Values.cloudflare.tokenSecretName }} + key: {{ .Values.cloudflare.tokenSecretKey }} +{{ range $prefix := .Values.cloudflare.certificateRootDomains }} +--- +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: cloudflare-wildcard{{$prefix}}.{{ $.Values.global.rootSubDomain }}.{{ $.Values.global.domain }} +spec: + secretName: cloudflare-wildcard{{$prefix}}.{{ $.Values.global.rootSubDomain }}.{{ $.Values.global.domain }} + issuerRef: + name: cloudflare + kind: Issuer + commonName: '*{{$prefix}}.{{ $.Values.global.rootSubDomain }}.{{ $.Values.global.domain }}' + dnsNames: + - "*{{$prefix}}.{{ $.Values.global.rootSubDomain }}.{{ $.Values.global.domain }}" +{{ end }} +--- +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: cloudflare-wildcard.{{ $.Values.global.domain }} +spec: + secretName: cloudflare-wildcard.{{ $.Values.global.domain }} + issuerRef: + name: cloudflare + kind: Issuer + commonName: '*.{{ $.Values.global.domain }}' + dnsNames: + - "*.{{ $.Values.global.domain }}" +--- +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: cloudflare-wildcard.{{ $.Values.global.secondaryDomain }} +spec: + secretName: cloudflare-wildcard.{{ $.Values.global.secondaryDomain }} + issuerRef: + name: cloudflare + kind: Issuer + commonName: '*.{{ $.Values.global.secondaryDomain }}' + dnsNames: + - "*.{{ $.Values.global.secondaryDomain }}" +--- +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: cloudflare.{{ $.Values.global.domain }} +spec: + secretName: cloudflare.{{ $.Values.global.domain }} + issuerRef: + name: cloudflare + kind: Issuer + commonName: '{{ $.Values.global.domain }}' + dnsNames: + - "{{ $.Values.global.domain }}" +--- +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: cloudflare.{{ $.Values.global.secondaryDomain }} +spec: + secretName: cloudflare.{{ $.Values.global.secondaryDomain }} + issuerRef: + name: cloudflare + kind: Issuer + commonName: '{{ $.Values.global.secondaryDomain }}' + dnsNames: + - "{{ $.Values.global.secondaryDomain }}" +{{ end }} +{{ end }} \ No newline at end of file diff --git a/charts/apps/ingress/templates/dummy-pod.yaml b/charts/apps/ingress/templates/dummy-pod.yaml deleted file mode 100644 index 9454f4c..0000000 --- a/charts/apps/ingress/templates/dummy-pod.yaml +++ /dev/null @@ -1,38 +0,0 @@ ---- -kind: Deployment -apiVersion: apps/v1 -metadata: - name: dummy-app - namespace: "{{ .Release.Namespace }}" -spec: - replicas: 1 - selector: - matchLabels: - app: dummy - template: - metadata: - labels: - app: dummy - spec: - containers: - - name: name - image: nginxdemos/hello - resources: - limits: - memory: 1Gi - ports: - - containerPort: 80 ---- -kind: Service -apiVersion: v1 -metadata: - name: dummy-app -spec: - selector: - app: dummy - release: "{{ .Release.Name }}" - type: ClusterIP - ports: - - name: http - port: 80 - targetPort: 80 \ No newline at end of file diff --git a/charts/apps/ingress/values-dev.yaml b/charts/apps/ingress/values-dev.yaml new file mode 100644 index 0000000..e69de29 diff --git a/charts/apps/ingress/values-prod.yaml b/charts/apps/ingress/values-prod.yaml new file mode 100644 index 0000000..67313b7 --- /dev/null +++ b/charts/apps/ingress/values-prod.yaml @@ -0,0 +1,2 @@ +cloudflare: + enabled: true \ No newline at end of file diff --git a/charts/apps/ingress/values.yaml b/charts/apps/ingress/values.yaml index e69de29..4621400 100644 --- a/charts/apps/ingress/values.yaml +++ b/charts/apps/ingress/values.yaml @@ -0,0 +1,9 @@ +cloudflare: + enabled: false + tokenSecretName: ~ + tokenSecretKey: ~ + certificateRootDomains: + - "" + - ".core" + - ".vh" + - ".wa" \ No newline at end of file diff --git a/charts/infrastructure/templates/argocd-appset.yml b/charts/infrastructure/templates/argocd-appset.yml index fb1b71b..a1bbbeb 100644 --- a/charts/infrastructure/templates/argocd-appset.yml +++ b/charts/infrastructure/templates/argocd-appset.yml @@ -28,4 +28,11 @@ spec: source: path: '{{`{{path}}`}}' repoURL: git@github.com:{{ .Values.gitops.repo }}.git - targetRevision: "{{ .Values.gitops.revision }}" \ No newline at end of file + targetRevision: "{{ .Values.gitops.revision }}" + helm: + valueFiles: + - values.yaml + - values-{{$.Values.global.deployment}}.yaml + values: |- + global: + {{ .Values.global | toYaml | nindent 20 }} \ No newline at end of file diff --git a/charts/infrastructure/values.yaml b/charts/infrastructure/values.yaml index 5a3ae12..b0129d2 100644 --- a/charts/infrastructure/values.yaml +++ b/charts/infrastructure/values.yaml @@ -1,8 +1,4 @@ -global: - timezone: America/Toronto - nfs: - server: 10.0.10.1 - rootPath: /mnt/EightTerra/k3s-cluster/direct-mounts +global: {} registry: ip: 10.0.100.101