From 121a3c1a44db8f073286c64cb494297eed15327a Mon Sep 17 00:00:00 2001 From: Ari Sosnovsky Date: Mon, 10 Apr 2023 09:45:00 -0400 Subject: [PATCH] added ingress and pvc class --- k8s/charts/templates/app-nfs-storage.yaml | 2 +- k8s/charts/templates/app-prometheus.yaml | 39 +++++++++++++++++++++++ k8s/charts/values.yaml | 4 ++- 3 files changed, 43 insertions(+), 2 deletions(-) diff --git a/k8s/charts/templates/app-nfs-storage.yaml b/k8s/charts/templates/app-nfs-storage.yaml index e419669..08915e9 100644 --- a/k8s/charts/templates/app-nfs-storage.yaml +++ b/k8s/charts/templates/app-nfs-storage.yaml @@ -18,7 +18,7 @@ spec: - name: nfs.path value: "{{ .Values.nfs.share }}" - name: storageClass.name - value: "nfs-generic" + value: "{{ .Values.global.nfsStorageClass }}" destination: server: https://kubernetes.default.svc namespace: "nfs-subdir-external-provisioner" diff --git a/k8s/charts/templates/app-prometheus.yaml b/k8s/charts/templates/app-prometheus.yaml index 0c8eb4a..12cff0e 100644 --- a/k8s/charts/templates/app-prometheus.yaml +++ b/k8s/charts/templates/app-prometheus.yaml @@ -1,3 +1,21 @@ +{{- $prometheusHost := "monitor.core" -}} +{{ if .Values.global.tls.enabled }} +--- +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: "tls-{{$prometheusHost}}.{{.Values.global.domain}}" + namespace: {{ .namespace }} +spec: + secretName: "tls-{{$prometheusHost}}.{{.Values.global.domain}}" + issuerRef: + kind: ClusterIssuer + name: "{{ .Values.global.tls.issuer }}" + commonName: "{{$prometheusHost}}.{{.Values.global.domain}}" + dnsNames: + - "{{$prometheusHost}}.{{.Values.global.domain}}" +{{ end }} + --- apiVersion: argoproj.io/v1alpha1 kind: Application @@ -12,6 +30,27 @@ spec: targetRevision: "{{ .Values.chartVersions.prometheus }}" helm: releaseName: prometheus + values: |- + server: + baseURL: "{{$prometheusHost}}.{{ .Values.global.domain }}" + persistentVolume: + enabled: true + size: 8Gi + storageClass: "{{ .Values.global.nfsStorageClass }}" + ingress: + enabled: true + ingressClassName: traefik + annotations: {} + hosts: + - "{{$prometheusHost}}.{{ .Values.global.domain }}" + path: / + pathType: Prefix +{{ if .Values.global.tls.enabled }} + tls: + - secretName: "tls-{{$prometheusHost}}.{{.Values.global.domain}}" + hosts: + - "{{$prometheusHost}}.{{ .Values.global.domain }}" +{{ end }} destination: server: https://kubernetes.default.svc namespace: "monitoring" diff --git a/k8s/charts/values.yaml b/k8s/charts/values.yaml index 326d349..9f9792c 100644 --- a/k8s/charts/values.yaml +++ b/k8s/charts/values.yaml @@ -5,4 +5,6 @@ chartVersions: kubernetesSecretGenerator: "v3.4.0" nfs: "v4.0.2" externalSecrets: "0.7.2" - certManager: "1.10.2" \ No newline at end of file + certManager: "1.10.2" +global: + nfsStorageClass: "nfs-generic" \ No newline at end of file