From 1f993da23ed07ffe5896f2c412d4365767f9557d Mon Sep 17 00:00:00 2001 From: Nicolas Date: Fri, 29 Aug 2025 03:53:51 +0000 Subject: [PATCH] revert e76da4ea1871dba913677b6beaf48956f77976a1 revert Remove all such cert usage(across all services) if service is already deployed in k8s --- .../templates/authentication/certificate.yaml | 27 +++++++++++++++++++ .../templates/authentication/ingress.yaml | 11 +++++++- .../chat/templates/chat/certificate.yaml | 27 +++++++++++++++++++ .../chat/templates/chat/chat-config.yaml | 1 + .../helm-pkg/chat/templates/chat/ingress.yaml | 10 +++++++ freeleaps/helm-pkg/chat/values.alpha.yaml | 1 + freeleaps/helm-pkg/chat/values.prod.yaml | 1 + freeleaps/helm-pkg/chat/values.yaml | 2 ++ .../templates/content/certificate.yaml | 27 +++++++++++++++++++ .../content/templates/content/ingress.yaml | 11 +++++++- .../devops/templates/devops/certificate.yaml | 27 +++++++++++++++++++ .../devops/templates/devops/ingress.yaml | 11 +++++++- .../devsvc/templates/devsvc/certificate.yaml | 27 +++++++++++++++++++ .../devsvc/templates/devsvc/ingress.yaml | 11 +++++++- .../templates/freeleaps/certificate.yaml | 27 +++++++++++++++++++ .../templates/freeleaps/freeleaps-config.yaml | 1 + .../templates/freeleaps/ingress.yaml | 13 ++++++--- .../helm-pkg/freeleaps/values.alpha.yaml | 1 + freeleaps/helm-pkg/freeleaps/values.prod.yaml | 3 ++- freeleaps/helm-pkg/freeleaps/values.yaml | 1 + .../templates/frontend/certificate.yaml | 27 +++++++++++++++++++ .../frontend/templates/frontend/ingress.yaml | 11 +++++++- .../templates/notification/certificate.yaml | 27 +++++++++++++++++++ .../templates/notification/ingress.yaml | 11 +++++++- .../templates/payment/certificate.yaml | 27 +++++++++++++++++++ .../payment/templates/payment/ingress.yaml | 10 +++++++ 26 files changed, 343 insertions(+), 10 deletions(-) create mode 100644 freeleaps/helm-pkg/authentication/templates/authentication/certificate.yaml create mode 100644 freeleaps/helm-pkg/chat/templates/chat/certificate.yaml create mode 100644 freeleaps/helm-pkg/content/templates/content/certificate.yaml create mode 100644 freeleaps/helm-pkg/devops/templates/devops/certificate.yaml create mode 100644 freeleaps/helm-pkg/devsvc/templates/devsvc/certificate.yaml create mode 100644 freeleaps/helm-pkg/freeleaps/templates/freeleaps/certificate.yaml create mode 100644 freeleaps/helm-pkg/frontend/templates/frontend/certificate.yaml create mode 100644 freeleaps/helm-pkg/notification/templates/notification/certificate.yaml create mode 100644 freeleaps/helm-pkg/payment/templates/payment/certificate.yaml diff --git a/freeleaps/helm-pkg/authentication/templates/authentication/certificate.yaml b/freeleaps/helm-pkg/authentication/templates/authentication/certificate.yaml new file mode 100644 index 00000000..5d9bb8e6 --- /dev/null +++ b/freeleaps/helm-pkg/authentication/templates/authentication/certificate.yaml @@ -0,0 +1,27 @@ +{{ $namespace := .Release.Namespace }} +{{ $appVersion := .Chart.AppVersion | quote }} +{{ $releaseCertificate := .Release.Service }} +{{ $releaseName := .Release.Name }} +{{- range $ingress := .Values.authentication.ingresses }} +{{- if not $ingress.tls.exists }} +--- +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: {{ $ingress.name }} + namespace: {{ $namespace }} + labels: + app.kubernetes.io/version: {{ $appVersion }} + app.kubernetes.io/name: {{ $ingress.name | quote }} + app.kubernetes.io/managed-by: {{ $releaseCertificate }} + app.kubernetes.io/instance: {{ $releaseName }} +spec: + commonName: {{ $ingress.host }} + dnsNames: + - {{ $ingress.host }} + issuerRef: + name: {{ $ingress.tls.issuerRef.name }} + kind: {{ $ingress.tls.issuerRef.kind }} + secretName: {{ $ingress.tls.name }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/freeleaps/helm-pkg/authentication/templates/authentication/ingress.yaml b/freeleaps/helm-pkg/authentication/templates/authentication/ingress.yaml index 0f0a418b..c685a5f8 100644 --- a/freeleaps/helm-pkg/authentication/templates/authentication/ingress.yaml +++ b/freeleaps/helm-pkg/authentication/templates/authentication/ingress.yaml @@ -18,7 +18,16 @@ spec: {{- if $ingress.class }} ingressClassName: {{ $ingress.class }} {{- end }} - +{{- if $ingress.tls }} + tls: + - hosts: + - {{ $ingress.host }} +{{- if $ingress.tls.exists }} + secretName: {{ $ingress.tls.secretRef.name }} +{{- else }} + secretName: {{ $ingress.tls.name }} +{{- end }} +{{- end }} rules: - host: {{ $ingress.host }} http: diff --git a/freeleaps/helm-pkg/chat/templates/chat/certificate.yaml b/freeleaps/helm-pkg/chat/templates/chat/certificate.yaml new file mode 100644 index 00000000..5067d104 --- /dev/null +++ b/freeleaps/helm-pkg/chat/templates/chat/certificate.yaml @@ -0,0 +1,27 @@ +{{ $namespace := .Release.Namespace }} +{{ $appVersion := .Chart.AppVersion | quote }} +{{ $releaseCertificate := .Release.Service }} +{{ $releaseName := .Release.Name }} +{{- range $ingress := .Values.chat.ingresses }} +{{- if not $ingress.tls.exists }} +--- +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: {{ $ingress.name }} + namespace: {{ $namespace }} + labels: + app.kubernetes.io/version: {{ $appVersion }} + app.kubernetes.io/name: {{ $ingress.name | quote }} + app.kubernetes.io/managed-by: {{ $releaseCertificate }} + app.kubernetes.io/instance: {{ $releaseName }} +spec: + commonName: {{ $ingress.host }} + dnsNames: + - {{ $ingress.host }} + issuerRef: + name: {{ $ingress.tls.issuerRef.name }} + kind: {{ $ingress.tls.issuerRef.kind }} + secretName: {{ $ingress.tls.name }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/freeleaps/helm-pkg/chat/templates/chat/chat-config.yaml b/freeleaps/helm-pkg/chat/templates/chat/chat-config.yaml index 7923c835..42d898b8 100644 --- a/freeleaps/helm-pkg/chat/templates/chat/chat-config.yaml +++ b/freeleaps/helm-pkg/chat/templates/chat/chat-config.yaml @@ -25,6 +25,7 @@ data: FREELEAPS_AILAB_ENDPOINT: {{ .Values.chat.configs.freeleapsAilabEndpoint | b64enc | quote }} FREELEAPS_NOTIFICATION_ENDPOINT: {{ .Values.chat.configs.freeleapsNotificationEndpoint | b64enc | quote }} FREELEAPS_ENV: {{ .Values.chat.configs.freeleapsEnv | b64enc | quote }} + CERT_PATH: {{ .Values.chat.configs.certPath | b64enc | quote }} REDIS_IS_CLUSTER: {{ .Values.chat.configs.redisIsCluster | b64enc | quote }} METRICS_ENABLED: {{ .Values.chat.configs.metricsEnabled | default false | toString | b64enc }} PROBES_ENABLED: {{ .Values.chat.configs.probesEnabled | default false | toString | b64enc }} \ No newline at end of file diff --git a/freeleaps/helm-pkg/chat/templates/chat/ingress.yaml b/freeleaps/helm-pkg/chat/templates/chat/ingress.yaml index 8736c1ca..8fed2b70 100644 --- a/freeleaps/helm-pkg/chat/templates/chat/ingress.yaml +++ b/freeleaps/helm-pkg/chat/templates/chat/ingress.yaml @@ -17,6 +17,16 @@ metadata: spec: {{- if $ingress.class }} ingressClassName: {{ $ingress.class }} +{{- end }} +{{- if $ingress.tls }} + tls: + - hosts: + - {{ $ingress.host }} +{{- if $ingress.tls.exists }} + secretName: {{ $ingress.tls.secretRef.name }} +{{- else }} + secretName: {{ $ingress.tls.name }} +{{- end }} {{- end }} rules: - host: {{ $ingress.host }} diff --git a/freeleaps/helm-pkg/chat/values.alpha.yaml b/freeleaps/helm-pkg/chat/values.alpha.yaml index 1d6889a4..81e22f4f 100644 --- a/freeleaps/helm-pkg/chat/values.alpha.yaml +++ b/freeleaps/helm-pkg/chat/values.alpha.yaml @@ -97,6 +97,7 @@ chat: freeleapsNotificationEndpoint: http://notification-service.freeleaps-alpha.svc.freeleaps.cluster:8003/api/notification/ freeleapsAilabEndpoint: '' freeleapsEnv: alpha + certPath: '' redisIsCluster: 'false' metricsEnabled: 'true' probesEnabled: 'true' diff --git a/freeleaps/helm-pkg/chat/values.prod.yaml b/freeleaps/helm-pkg/chat/values.prod.yaml index ea1a0046..91e2c5e4 100644 --- a/freeleaps/helm-pkg/chat/values.prod.yaml +++ b/freeleaps/helm-pkg/chat/values.prod.yaml @@ -88,6 +88,7 @@ chat: freeleapsNotificationEndpoint: http://notification-service.freeleaps-prod.svc.freeleaps.cluster:8003/api/notification/ freeleapsAilabEndpoint: '' freeleapsEnv: chat + certPath: '' redisIsCluster: 'true' metricsEnabled: 'false' probesEnabled: 'true' diff --git a/freeleaps/helm-pkg/chat/values.yaml b/freeleaps/helm-pkg/chat/values.yaml index d0ee2178..dbc37753 100644 --- a/freeleaps/helm-pkg/chat/values.yaml +++ b/freeleaps/helm-pkg/chat/values.yaml @@ -106,6 +106,8 @@ chat: freeleapsAilabEndpoint: "" # FREELEAPS_ENV freeleapsEnv: "" + # CERT_PATH + certPath: "" # REDIS_IS_CLUSTER redisIsCluster: "false" # METRICS_ENABLED diff --git a/freeleaps/helm-pkg/content/templates/content/certificate.yaml b/freeleaps/helm-pkg/content/templates/content/certificate.yaml new file mode 100644 index 00000000..b6d55726 --- /dev/null +++ b/freeleaps/helm-pkg/content/templates/content/certificate.yaml @@ -0,0 +1,27 @@ +{{ $namespace := .Release.Namespace }} +{{ $appVersion := .Chart.AppVersion | quote }} +{{ $releaseCertificate := .Release.Service }} +{{ $releaseName := .Release.Name }} +{{- range $ingress := .Values.content.ingresses }} +{{- if not $ingress.tls.exists }} +--- +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: {{ $ingress.name }} + namespace: {{ $namespace }} + labels: + app.kubernetes.io/version: {{ $appVersion }} + app.kubernetes.io/name: {{ $ingress.name | quote }} + app.kubernetes.io/managed-by: {{ $releaseCertificate }} + app.kubernetes.io/instance: {{ $releaseName }} +spec: + commonName: {{ $ingress.host }} + dnsNames: + - {{ $ingress.host }} + issuerRef: + name: {{ $ingress.tls.issuerRef.name }} + kind: {{ $ingress.tls.issuerRef.kind }} + secretName: {{ $ingress.tls.name }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/freeleaps/helm-pkg/content/templates/content/ingress.yaml b/freeleaps/helm-pkg/content/templates/content/ingress.yaml index ce572b4e..9b0cc918 100644 --- a/freeleaps/helm-pkg/content/templates/content/ingress.yaml +++ b/freeleaps/helm-pkg/content/templates/content/ingress.yaml @@ -18,7 +18,16 @@ spec: {{- if $ingress.class }} ingressClassName: {{ $ingress.class }} {{- end }} - +{{- if $ingress.tls }} + tls: + - hosts: + - {{ $ingress.host }} +{{- if $ingress.tls.exists }} + secretName: {{ $ingress.tls.secretRef.name }} +{{- else }} + secretName: {{ $ingress.tls.name }} +{{- end }} +{{- end }} rules: - host: {{ $ingress.host }} http: diff --git a/freeleaps/helm-pkg/devops/templates/devops/certificate.yaml b/freeleaps/helm-pkg/devops/templates/devops/certificate.yaml new file mode 100644 index 00000000..39615558 --- /dev/null +++ b/freeleaps/helm-pkg/devops/templates/devops/certificate.yaml @@ -0,0 +1,27 @@ +{{ $namespace := .Release.Namespace }} +{{ $appVersion := .Chart.AppVersion | quote }} +{{ $releaseCertificate := .Release.Service }} +{{ $releaseName := .Release.Name }} +{{- range $ingress := .Values.devops.ingresses }} +{{- if not $ingress.tls.exists }} +--- +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: {{ $ingress.name }} + namespace: {{ $namespace }} + labels: + app.kubernetes.io/version: {{ $appVersion }} + app.kubernetes.io/name: {{ $ingress.name | quote }} + app.kubernetes.io/managed-by: {{ $releaseCertificate }} + app.kubernetes.io/instance: {{ $releaseName }} +spec: + commonName: {{ $ingress.host }} + dnsNames: + - {{ $ingress.host }} + issuerRef: + name: {{ $ingress.tls.issuerRef.name }} + kind: {{ $ingress.tls.issuerRef.kind }} + secretName: {{ $ingress.tls.name }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/freeleaps/helm-pkg/devops/templates/devops/ingress.yaml b/freeleaps/helm-pkg/devops/templates/devops/ingress.yaml index 4531312b..ed4f246d 100644 --- a/freeleaps/helm-pkg/devops/templates/devops/ingress.yaml +++ b/freeleaps/helm-pkg/devops/templates/devops/ingress.yaml @@ -18,7 +18,16 @@ spec: {{- if $ingress.class }} ingressClassName: {{ $ingress.class }} {{- end }} - +{{- if $ingress.tls }} + tls: + - hosts: + - {{ $ingress.host }} +{{- if $ingress.tls.exists }} + secretName: {{ $ingress.tls.secretRef.name }} +{{- else }} + secretName: {{ $ingress.tls.name }} +{{- end }} +{{- end }} rules: - host: {{ $ingress.host }} http: diff --git a/freeleaps/helm-pkg/devsvc/templates/devsvc/certificate.yaml b/freeleaps/helm-pkg/devsvc/templates/devsvc/certificate.yaml new file mode 100644 index 00000000..e70aff83 --- /dev/null +++ b/freeleaps/helm-pkg/devsvc/templates/devsvc/certificate.yaml @@ -0,0 +1,27 @@ +{{ $namespace := .Release.Namespace }} +{{ $appVersion := .Chart.AppVersion | quote }} +{{ $releaseCertificate := .Release.Service }} +{{ $releaseName := .Release.Name }} +{{- range $ingress := .Values.devsvc.ingresses }} +{{- if not $ingress.tls.exists }} +--- +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: {{ $ingress.name }} + namespace: {{ $namespace }} + labels: + app.kubernetes.io/version: {{ $appVersion }} + app.kubernetes.io/name: {{ $ingress.name | quote }} + app.kubernetes.io/managed-by: {{ $releaseCertificate }} + app.kubernetes.io/instance: {{ $releaseName }} +spec: + commonName: {{ $ingress.host }} + dnsNames: + - {{ $ingress.host }} + issuerRef: + name: {{ $ingress.tls.issuerRef.name }} + kind: {{ $ingress.tls.issuerRef.kind }} + secretName: {{ $ingress.tls.name }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/freeleaps/helm-pkg/devsvc/templates/devsvc/ingress.yaml b/freeleaps/helm-pkg/devsvc/templates/devsvc/ingress.yaml index 846601b4..d98161b7 100644 --- a/freeleaps/helm-pkg/devsvc/templates/devsvc/ingress.yaml +++ b/freeleaps/helm-pkg/devsvc/templates/devsvc/ingress.yaml @@ -18,7 +18,16 @@ spec: {{- if $ingress.class }} ingressClassName: {{ $ingress.class }} {{- end }} - +{{- if $ingress.tls }} + tls: + - hosts: + - {{ $ingress.host }} +{{- if $ingress.tls.exists }} + secretName: {{ $ingress.tls.secretRef.name }} +{{- else }} + secretName: {{ $ingress.tls.name }} +{{- end }} +{{- end }} rules: - host: {{ $ingress.host }} http: diff --git a/freeleaps/helm-pkg/freeleaps/templates/freeleaps/certificate.yaml b/freeleaps/helm-pkg/freeleaps/templates/freeleaps/certificate.yaml new file mode 100644 index 00000000..9833932b --- /dev/null +++ b/freeleaps/helm-pkg/freeleaps/templates/freeleaps/certificate.yaml @@ -0,0 +1,27 @@ +{{ $namespace := .Release.Namespace }} +{{ $appVersion := .Chart.AppVersion | quote }} +{{ $releaseCertificate := .Release.Service }} +{{ $releaseName := .Release.Name }} +{{- range $ingress := .Values.freeleaps.ingresses }} +{{- if not $ingress.tls.exists }} +--- +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: {{ $ingress.name }} + namespace: {{ $namespace }} + labels: + app.kubernetes.io/version: {{ $appVersion }} + app.kubernetes.io/name: {{ $ingress.name | quote }} + app.kubernetes.io/managed-by: {{ $releaseCertificate }} + app.kubernetes.io/instance: {{ $releaseName }} +spec: + commonName: {{ $ingress.host }} + dnsNames: + - {{ $ingress.host }} + issuerRef: + name: {{ $ingress.tls.issuerRef.name }} + kind: {{ $ingress.tls.issuerRef.kind }} + secretName: {{ $ingress.tls.name }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/freeleaps/helm-pkg/freeleaps/templates/freeleaps/freeleaps-config.yaml b/freeleaps/helm-pkg/freeleaps/templates/freeleaps/freeleaps-config.yaml index 907029ec..0c710e3b 100644 --- a/freeleaps/helm-pkg/freeleaps/templates/freeleaps/freeleaps-config.yaml +++ b/freeleaps/helm-pkg/freeleaps/templates/freeleaps/freeleaps-config.yaml @@ -26,6 +26,7 @@ data: FREELEAPS_AILAB_ENDPOINT: {{ .Values.freeleaps.configs.freeleapsAilabEndpoint | b64enc | quote }} FREELEAPS_NOTIFICATION_ENDPOINT: {{ .Values.freeleaps.configs.freeleapsNotificationEndpoint | b64enc | quote }} FREELEAPS_ENV: {{ .Values.freeleaps.configs.freeleapsEnv | b64enc | quote }} + CERT_PATH: {{ .Values.freeleaps.configs.certPath | b64enc | quote }} REDIS_IS_CLUSTER: {{ .Values.freeleaps.configs.redisIsCluster | b64enc | quote }} METRICS_ENABLED: {{ .Values.freeleaps.configs.metricsEnabled | default false | toString | b64enc }} PROBES_ENABLED: {{ .Values.freeleaps.configs.probesEnabled | default false | toString | b64enc }} diff --git a/freeleaps/helm-pkg/freeleaps/templates/freeleaps/ingress.yaml b/freeleaps/helm-pkg/freeleaps/templates/freeleaps/ingress.yaml index 3fe2682a..d92ecf12 100644 --- a/freeleaps/helm-pkg/freeleaps/templates/freeleaps/ingress.yaml +++ b/freeleaps/helm-pkg/freeleaps/templates/freeleaps/ingress.yaml @@ -2,7 +2,6 @@ {{ $appVersion := .Chart.AppVersion | quote }} {{ $releaseIngress := .Release.Service }} {{ $releaseName := .Release.Name }} -{{- if ne .Values.freeleaps.configs.freeleapsEnv "prod" }} {{- range $ingress := .Values.freeleaps.ingresses }} --- apiVersion: networking.k8s.io/v1 @@ -19,11 +18,19 @@ spec: {{- if $ingress.class }} ingressClassName: {{ $ingress.class }} {{- end }} - +{{- if $ingress.tls }} + tls: + - hosts: + - {{ $ingress.host }} +{{- if $ingress.tls.exists }} + secretName: {{ $ingress.tls.secretRef.name }} +{{- else }} + secretName: {{ $ingress.tls.name }} +{{- end }} +{{- end }} rules: - host: {{ $ingress.host }} http: paths: {{- toYaml $ingress.rules | nindent 10 }} -{{- end }} {{- end }} \ No newline at end of file diff --git a/freeleaps/helm-pkg/freeleaps/values.alpha.yaml b/freeleaps/helm-pkg/freeleaps/values.alpha.yaml index c33407b2..2c5a6a22 100644 --- a/freeleaps/helm-pkg/freeleaps/values.alpha.yaml +++ b/freeleaps/helm-pkg/freeleaps/values.alpha.yaml @@ -77,6 +77,7 @@ freeleaps: freeleapsNotificationEndpoint: http://notification-service.freeleaps-alpha.svc.freeleaps.cluster:8003/api/notification/ freeleapsAilabEndpoint: '' freeleapsEnv: alpha + certPath: '' redisIsCluster: 'false' metricsEnabled: 'false' probesEnabled: 'true' diff --git a/freeleaps/helm-pkg/freeleaps/values.prod.yaml b/freeleaps/helm-pkg/freeleaps/values.prod.yaml index 4a38bac0..31a31699 100644 --- a/freeleaps/helm-pkg/freeleaps/values.prod.yaml +++ b/freeleaps/helm-pkg/freeleaps/values.prod.yaml @@ -67,7 +67,8 @@ freeleaps: freeleapsAuthenticationEndpoint: http://authentication-service.freeleaps-prod.svc.freeleaps.cluster:8004/api/auth/ freeleapsNotificationEndpoint: http://notification-service.freeleaps-prod.svc.freeleaps.cluster:8003/api/notification/ freeleapsAilabEndpoint: '' - freeleapsEnv: prod + freeleapsEnv: alpha + certPath: '' redisIsCluster: 'true' metricsEnabled: 'true' probesEnabled: 'true' diff --git a/freeleaps/helm-pkg/freeleaps/values.yaml b/freeleaps/helm-pkg/freeleaps/values.yaml index d819fa3f..a5ac4af8 100644 --- a/freeleaps/helm-pkg/freeleaps/values.yaml +++ b/freeleaps/helm-pkg/freeleaps/values.yaml @@ -92,6 +92,7 @@ freeleaps: # FREELEAPS_ENV freeleapsEnv: "" # CERT_PATH + certPath: "" # REDIS_IS_CLUSTER redisIsCluster: "false" # METRICS_ENABLED diff --git a/freeleaps/helm-pkg/frontend/templates/frontend/certificate.yaml b/freeleaps/helm-pkg/frontend/templates/frontend/certificate.yaml new file mode 100644 index 00000000..40ef77e3 --- /dev/null +++ b/freeleaps/helm-pkg/frontend/templates/frontend/certificate.yaml @@ -0,0 +1,27 @@ +{{ $namespace := .Release.Namespace }} +{{ $appVersion := .Chart.AppVersion | quote }} +{{ $releaseCertificate := .Release.Service }} +{{ $releaseName := .Release.Name }} +{{- range $ingress := .Values.frontend.ingresses }} +{{- if not $ingress.tls.exists }} +--- +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: {{ $ingress.name }} + namespace: {{ $namespace }} + labels: + app.kubernetes.io/version: {{ $appVersion }} + app.kubernetes.io/name: {{ $ingress.name | quote }} + app.kubernetes.io/managed-by: {{ $releaseCertificate }} + app.kubernetes.io/instance: {{ $releaseName }} +spec: + commonName: {{ $ingress.host }} + dnsNames: + - {{ $ingress.host }} + issuerRef: + name: {{ $ingress.tls.issuerRef.name }} + kind: {{ $ingress.tls.issuerRef.kind }} + secretName: {{ $ingress.tls.name }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/freeleaps/helm-pkg/frontend/templates/frontend/ingress.yaml b/freeleaps/helm-pkg/frontend/templates/frontend/ingress.yaml index 09be3161..c113116e 100644 --- a/freeleaps/helm-pkg/frontend/templates/frontend/ingress.yaml +++ b/freeleaps/helm-pkg/frontend/templates/frontend/ingress.yaml @@ -22,7 +22,16 @@ spec: {{- if $ingress.class }} ingressClassName: {{ $ingress.class }} {{- end }} - +{{- if $ingress.tls }} + tls: + - hosts: + - {{ $ingress.host }} +{{- if $ingress.tls.exists }} + secretName: {{ $ingress.tls.secretRef.name }} +{{- else }} + secretName: {{ $ingress.tls.name }} +{{- end }} +{{- end }} rules: - host: {{ $ingress.host }} http: diff --git a/freeleaps/helm-pkg/notification/templates/notification/certificate.yaml b/freeleaps/helm-pkg/notification/templates/notification/certificate.yaml new file mode 100644 index 00000000..b970313f --- /dev/null +++ b/freeleaps/helm-pkg/notification/templates/notification/certificate.yaml @@ -0,0 +1,27 @@ +{{ $namespace := .Release.Namespace }} +{{ $appVersion := .Chart.AppVersion | quote }} +{{ $releaseCertificate := .Release.Service }} +{{ $releaseName := .Release.Name }} +{{- range $ingress := .Values.notification.ingresses }} +{{- if not $ingress.tls.exists }} +--- +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: {{ $ingress.name }} + namespace: {{ $namespace }} + labels: + app.kubernetes.io/version: {{ $appVersion }} + app.kubernetes.io/name: {{ $ingress.name | quote }} + app.kubernetes.io/managed-by: {{ $releaseCertificate }} + app.kubernetes.io/instance: {{ $releaseName }} +spec: + commonName: {{ $ingress.host }} + dnsNames: + - {{ $ingress.host }} + issuerRef: + name: {{ $ingress.tls.issuerRef.name }} + kind: {{ $ingress.tls.issuerRef.kind }} + secretName: {{ $ingress.tls.name }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/freeleaps/helm-pkg/notification/templates/notification/ingress.yaml b/freeleaps/helm-pkg/notification/templates/notification/ingress.yaml index aefc071a..ac0c7cc1 100644 --- a/freeleaps/helm-pkg/notification/templates/notification/ingress.yaml +++ b/freeleaps/helm-pkg/notification/templates/notification/ingress.yaml @@ -18,7 +18,16 @@ spec: {{- if $ingress.class }} ingressClassName: {{ $ingress.class }} {{- end }} - +{{- if $ingress.tls }} + tls: + - hosts: + - {{ $ingress.host }} +{{- if $ingress.tls.exists }} + secretName: {{ $ingress.tls.secretRef.name }} +{{- else }} + secretName: {{ $ingress.tls.name }} +{{- end }} +{{- end }} rules: - host: {{ $ingress.host }} http: diff --git a/freeleaps/helm-pkg/payment/templates/payment/certificate.yaml b/freeleaps/helm-pkg/payment/templates/payment/certificate.yaml new file mode 100644 index 00000000..6619165c --- /dev/null +++ b/freeleaps/helm-pkg/payment/templates/payment/certificate.yaml @@ -0,0 +1,27 @@ +{{ $namespace := .Release.Namespace }} +{{ $appVersion := .Chart.AppVersion | quote }} +{{ $releaseCertificate := .Release.Service }} +{{ $releaseName := .Release.Name }} +{{- range $ingress := .Values.payment.ingresses }} +{{- if not $ingress.tls.exists }} +--- +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: {{ $ingress.name }} + namespace: {{ $namespace }} + labels: + app.kubernetes.io/version: {{ $appVersion }} + app.kubernetes.io/name: {{ $ingress.name | quote }} + app.kubernetes.io/managed-by: {{ $releaseCertificate }} + app.kubernetes.io/instance: {{ $releaseName }} +spec: + commonName: {{ $ingress.host }} + dnsNames: + - {{ $ingress.host }} + issuerRef: + name: {{ $ingress.tls.issuerRef.name }} + kind: {{ $ingress.tls.issuerRef.kind }} + secretName: {{ $ingress.tls.name }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/freeleaps/helm-pkg/payment/templates/payment/ingress.yaml b/freeleaps/helm-pkg/payment/templates/payment/ingress.yaml index b10111a6..0ea04b1c 100644 --- a/freeleaps/helm-pkg/payment/templates/payment/ingress.yaml +++ b/freeleaps/helm-pkg/payment/templates/payment/ingress.yaml @@ -17,6 +17,16 @@ metadata: spec: {{- if $ingress.class }} ingressClassName: {{ $ingress.class }} +{{- end }} +{{- if $ingress.tls }} + tls: + - hosts: + - {{ $ingress.host }} +{{- if $ingress.tls.exists }} + secretName: {{ $ingress.tls.secretRef.name }} +{{- else }} + secretName: {{ $ingress.tls.name }} +{{- end }} {{- end }} rules: - host: {{ $ingress.host }}