diff --git a/templates/config-map.yaml b/templates/config-map.yaml new file mode 100644 index 0000000..9ad79bc --- /dev/null +++ b/templates/config-map.yaml @@ -0,0 +1,31 @@ +{{- if .Values.configmap }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Values.configmap.name | default .Release.Name | quote }} + labels: + "app.kubernetes.io/name": {{ .Release.Name | quote }} + "app.kubernetes.io/managed-by": {{ .Release.Service | quote }} + {{- range $labelName, $labelValue := .Values.labels }} + {{ $labelName | quote }}: {{ $labelValue | quote }} + {{- end }} + annotations: + "helm.sh/chart": "{{ .Chart.Name }}-{{ .Chart.Version }}" + {{- range $annotationName, $annotationValue := .Values.annotations }} + {{ $annotationName | quote }}: {{ $annotationValue | quote }} + {{- end }} + {{- range $annotationName, $annotationValue := .Values.configmap.annotations }} + {{ $annotationName | quote }}: {{ $annotationValue | quote }} + {{- end }} +data: + {{- if .Values.configmap.data }} + {{- range $key, $value := .Values.configmap.data }} + {{- if kindIs "string" $value }} + {{ $key }}: {{ $value | quote }} + {{- else }} + {{ $key }}: {{ $value | toYaml | quote }} + {{- end }} + {{- end }} + {{- else }} + {{- end }} +{{- end }} diff --git a/templates/deployment.yaml b/templates/deployment.yaml index 180bf94..d880971 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -40,6 +40,7 @@ metadata: {{- end }} spec: replicas: {{ $.Values.replicas | default 1 }} + revisionHistoryLimit: {{ $.Values.revisionHistoryLimit | default 3 }} {{- if eq $kind "Deployment" }} strategy: {{- if $.Values.rollingUpdate }} @@ -160,9 +161,6 @@ spec: {{- if $.Values.schedulerName }} schedulerName: {{ $.Values.schedulerName }} {{- end }} - {{- if $.Values.serviceAccount }} - serviceAccount: {{ $.Values.serviceAccount }} - {{- end }} {{- if $.Values.serviceAccountName }} serviceAccountName: {{ $.Values.serviceAccountName }} {{- end }} @@ -184,7 +182,7 @@ spec: {{ toYaml $.Values.ephemeralContainers | indent 8 }} containers: {{- range $containerIndex, $container := $.Values.containers }} - - image: {{ $container.image | quote }} + - image: "{{ $container.image }}:{{ $container.imageTag | default "latest" }}" {{- if $container.name }} name: {{ $container.name | quote }} {{- else }} diff --git a/templates/ingress.yaml b/templates/ingress.yaml index b844ec4..38456be 100644 --- a/templates/ingress.yaml +++ b/templates/ingress.yaml @@ -43,31 +43,17 @@ metadata: {{- end }} annotations: "helm.sh/chart": "{{ $.Chart.Name }}-{{ $.Chart.Version }}" - {{- if $.Values.ingress.certmanager }} - {{- $addClusterIssuer := true }} - {{- $addIngressClass := true }} {{- range $annotationName, $annotationValue := $.Values.ingress.annotations }} - {{- if or (eq $annotationName "cert-manager.io/cluster-issuer") (eq $annotationName "certmanager.k8s.io/cluster-issuer") (eq $annotationName "cert-manager.io/issuer") (eq $annotationName "certmanager.k8s.io/issuer") }} - {{- $addClusterIssuer = false }} - {{- end }} - {{- if or (eq $annotationName "acme.cert-manager.io/http01-ingress-class") (eq $annotationName "certmanager.k8s.io/http01-ingress-class") }} - {{- $addIngressClass = false }} - {{- end }} {{ $annotationName | quote }}: {{ $annotationValue | quote }} {{- end }} + {{- if and $.Values.ingress.certmanager $.Values.ingress.tls }} {{- if ne (printf "%s" $tlsSecretName) "" }} - {{- if $addClusterIssuer }} - cert-manager.io/cluster-issuer: {{ $.Values.ingress.tlsClusterIssuer | default "lets-encrypt-http-issuer" | quote }} - certmanager.k8s.io/cluster-issuer: {{ $.Values.ingress.tlsClusterIssuer | default "lets-encrypt-http-issuer" | quote }} - {{- end }} - {{- if $addIngressClass }} - acme.cert-manager.io/http01-ingress-class: {{ $.Values.ingress.ingressClass | default "nginx" | quote }} - certmanager.k8s.io/http01-ingress-class: {{ $.Values.ingress.ingressClass | default "nginx" | quote }} + {{- if not (hasKey $.Values.ingress.annotations "cert-manager.io/cluster-issuer") }} + cert-manager.io/cluster-issuer: {{ $.Values.ingress.tlsClusterIssuer | default "cert-manager-letsencrypt" | quote }} {{- end }} + {{- if not (hasKey $.Values.ingress.annotations "acme.cert-manager.io/http01-edit-in-place") }} + acme.cert-manager.io/http01-edit-in-place: "true" {{- end }} - {{- else }} - {{- range $annotationName, $annotationValue := $.Values.ingress.annotations }} - {{ $annotationName | quote }}: {{ $annotationValue | quote }} {{- end }} {{- end }} spec: diff --git a/values.yaml b/values.yaml index 3280c2c..93c06a4 100644 --- a/values.yaml +++ b/values.yaml @@ -6,6 +6,8 @@ containers: [] initContainers: [] +configmap: {} + service: type: ClusterIP labels: {}