diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a0e0433..90ec7ac 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,5 @@ variables: - HELM_CHART_VERSION: "1.0.0" + HELM_CHART_VERSION: "1.0.2" stages: - deploy diff --git a/Chart/templates/certificate.yaml b/Chart/templates/certificate.yaml index e404c6f..e05ff71 100644 --- a/Chart/templates/certificate.yaml +++ b/Chart/templates/certificate.yaml @@ -1,3 +1,4 @@ +{{- if and .Values.site.certificate .Values.site.certificate.certManager }} apiVersion: cert-manager.io/v1 kind: Certificate metadata: @@ -6,8 +7,21 @@ metadata: {{- include "..labels" . | nindent 8 }} spec: issuerRef: - name: cloudyne-internal-root-v2 - kind: ClusterIssuer + name: {{ .Values.site.certificate.issuerRef }} + kind: {{ .Values.site.certificate.issuerkind }} secretName: {{ include "..fullname" . }}-cert-secret - commonName: {{ .Values.site.url }} - dnsNames: {{ include "..domains" . | nindent 8 }} \ No newline at end of file + commonName: {{ .Values.site.domain }} + dnsNames: {{ include "..domains" . | nindent 8 }} +{{- else if and .Values.site.certificate .Values.site.certificate.custom .Values.site.certificate.custom.enabled }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "..fullname" . }}-cert-secret + labels: + {{- include "..labels" . | nindent 8 }} +type: kubernetes.io/tls +data: + tls.crt: {{ .Values.site.certificate.custom.cert | b64enc }} + tls.key: {{ .Values.site.certificate.custom.key | b64enc }} +{{- else }} +{{- end }} \ No newline at end of file diff --git a/Chart/templates/ingress.yaml b/Chart/templates/ingress.yaml index 7e4d800..32ae29f 100644 --- a/Chart/templates/ingress.yaml +++ b/Chart/templates/ingress.yaml @@ -9,10 +9,15 @@ metadata: {{- include "..labels" . | nindent 4 }} spec: ingressClassName: nginx - tls: +{{- if and .Values.site.certificate.certManager .Values.site.certificate.importCert }} + tls: - secretName: {{ include "..fullname" . }}-cert-secret - hosts: {{ include "..domains" . | nindent 8 }} - + hosts: {{ include "..domains" . | nindent 6 }} +{{- else if .Values.site.certificate.existingCert }} + tls: + - secretName: {{ .Values.site.certificate.existingCertName }} + hosts: {{ include "..domains" . | nindent 6 }} +{{- end }} rules: {{- range include "..domains" . | split "\n" }} - host: {{ . | replace "- " ""}} diff --git a/Chart/values.yaml b/Chart/values.yaml index 4c59eea..ed37c4f 100644 --- a/Chart/values.yaml +++ b/Chart/values.yaml @@ -25,6 +25,18 @@ site: webpRoute: true dbInstance: "" + certificate: + certManager: false + # issuerRef: "" + # issuerKind: "" + existingCert: false + # existingCertName: "" + importCert: false + # importCertValue: | + # .... + # importKeyValue: | + # .... + resources: replicas: 1 php: