Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions templates/config-map.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
6 changes: 2 additions & 4 deletions templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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 }}
Expand All @@ -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 }}
Expand Down
24 changes: 5 additions & 19 deletions templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
containers: []
initContainers: []

configmap: {}

service:
type: ClusterIP
labels: {}
Expand Down