diff --git a/src/main/helm/templates/ingress.yaml b/src/main/helm/templates/ingress.yaml index fe85cf3ea82a073c99575ed87a7e56bad6910bf8..c03c83992ec0a80c726b4c5ea0f5c05a058cdb50 100644 --- a/src/main/helm/templates/ingress.yaml +++ b/src/main/helm/templates/ingress.yaml @@ -27,20 +27,20 @@ apiVersion: networking.k8s.io/v1 kind: Ingress metadata: annotations: - {{- if (.Values.ingress).certManagerAnnotations -}} - {{- range (.Values.ingress).certManagerAnnotations }} -{{ . | indent 4 }} + {{- with (.Values.ingress).annotations }} +{{ toYaml . | indent 4 }} {{- end }} - {{- else if (.Values.ingress).use_staging_cert }} + {{- if not (.Values.ingress).disableDefaultCertManager }} + {{- if (.Values.ingress).use_staging_cert }} cert-manager.io/cluster-issuer: letsencrypt-staging {{- else }} cert-manager.io/cluster-issuer: letsencrypt-prod {{- end }} - nginx.ingress.kubernetes.io/proxy-body-size: 42m + {{- end }} name: {{ include "app.name" . }} namespace: {{ include "app.namespace" . }} spec: - {{- if and (.Values.ingress).className (ne (.Values).cluster_env "dataport") }} + {{- if and (.Values.ingress).className }} ingressClassName: {{ .Values.ingress.className }} {{- end }} rules: @@ -57,9 +57,11 @@ spec: tls: - hosts: - {{ include "app.ingress.host" . }} + {{- if not (.Values.ingress).skipTlsSecret -}} {{- if (.Values.ingress).tlsSecretName }} secretName: {{ (.Values.ingress).tlsSecretName }} - {{- else if ne (.Values).cluster_env "dataport" }} + {{- else }} secretName: {{ .Values.ozgcloud.bezeichner }}-{{ include "app.name" . }}-tls {{- end }} + {{- end }} {{- end -}} \ No newline at end of file diff --git a/src/main/helm/values.yaml b/src/main/helm/values.yaml index 240501d36a5cc48d18ae5bc3a324b985f47ca550..11fdeb4ae386e81f51da0db2f35833333c0079f8 100644 --- a/src/main/helm/values.yaml +++ b/src/main/helm/values.yaml @@ -22,8 +22,6 @@ # unter der Lizenz sind dem Lizenztext zu entnehmen. # -cluster_env: "" - baseUrl: test.sh.ozg-cloud.de image: diff --git a/src/test/helm/ingress-nginx-tests.yaml b/src/test/helm/ingress-nginx-tests.yaml index ea2c487475851f878d53a5b4b33805f0c385c760..4659dbbd94ab5784d075c00f1f8e76e6318fff05 100644 --- a/src/test/helm/ingress-nginx-tests.yaml +++ b/src/test/helm/ingress-nginx-tests.yaml @@ -43,27 +43,13 @@ tests: path: spec.tls[0].secretName value: helm-fs-adapter-tls - - it: should not create afm ingress tls/ingressClass - release: - name: afm-adapter - set: - cluster_env: dataport - asserts: - - isNull: - path: spec.ingressClassName - - isNull: - path: spec.tls[0].secretName - - it: should not create afm ingress tls/ingressClass - release: - name: fs-adapter + - it: should not set secretName set: - image.name: formsolutions-adapter - cluster_env: dataport + ingress.skipTlsSecret: true asserts: - - isNull: - path: spec.ingressClassName - isNull: path: spec.tls[0].secretName + - it: should not set ingressClassName asserts: - isNull: diff --git a/src/test/helm/ingress_test.yaml b/src/test/helm/ingress_test.yaml index e5086079b97d4b11763d648d70352412d4e8d7ac..493d124a19b6f9d087d1d850dbdeaaea312535c3 100644 --- a/src/test/helm/ingress_test.yaml +++ b/src/test/helm/ingress_test.yaml @@ -125,7 +125,19 @@ tests: - equal: path: metadata.annotations["cert-manager.io/cluster-issuer"] value: letsencrypt-prod - - it: should set proxy body size to 42m + + - it: should disable default cert-manager + set: + ingress.disableDefaultCertManager: true + asserts: + - notExists: + path: metadata.annotations["cert-manager.io/cluster-issuer"] + + - it: should set ingress annotation proxy body size to 42m + set: + ingress: + annotations: + nginx.ingress.kubernetes.io/proxy-body-size: 42m asserts: - equal: path: metadata.annotations["nginx.ingress.kubernetes.io/proxy-body-size"]