cert-manager: upgrade from 1.12.17 to 1.17.4
Change-Id: Iea0d6eac22a57f9f1fc522e6abdd9359fbbd1415
diff --git a/charts/cert-manager/templates/webhook-deployment.yaml b/charts/cert-manager/templates/webhook-deployment.yaml
index 043c4b1..857cf35 100644
--- a/charts/cert-manager/templates/webhook-deployment.yaml
+++ b/charts/cert-manager/templates/webhook-deployment.yaml
@@ -15,6 +15,10 @@
{{- end }}
spec:
replicas: {{ .Values.webhook.replicaCount }}
+ {{- /* The if statement below is equivalent to {{- if $value }} but will also return true for 0. */ -}}
+ {{- if not (has (quote .Values.global.revisionHistoryLimit) (list "" (quote ""))) }}
+ revisionHistoryLimit: {{ .Values.global.revisionHistoryLimit }}
+ {{- end }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "webhook.name" . }}
@@ -39,11 +43,26 @@
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
+ {{- if and .Values.prometheus.enabled (not (or .Values.prometheus.servicemonitor.enabled .Values.prometheus.podmonitor.enabled)) }}
+ {{- if not .Values.webhook.podAnnotations }}
+ annotations:
+ {{- end }}
+ prometheus.io/path: "/metrics"
+ prometheus.io/scrape: 'true'
+ prometheus.io/port: '9402'
+ {{- end }}
spec:
+ {{- if not .Values.webhook.serviceAccount.create }}
+ {{- with .Values.global.imagePullSecrets }}
+ imagePullSecrets:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- end }}
serviceAccountName: {{ template "webhook.serviceAccountName" . }}
{{- if hasKey .Values.webhook "automountServiceAccountToken" }}
automountServiceAccountToken: {{ .Values.webhook.automountServiceAccountToken }}
{{- end }}
+ enableServiceLinks: {{ .Values.webhook.enableServiceLinks }}
{{- with .Values.global.priorityClassName }}
priorityClassName: {{ . | quote }}
{{- end }}
@@ -54,14 +73,16 @@
{{- if .Values.webhook.hostNetwork }}
hostNetwork: true
{{- end }}
+ {{- if .Values.webhook.hostNetwork }}
+ dnsPolicy: ClusterFirstWithHostNet
+ {{- end }}
containers:
- name: {{ .Chart.Name }}-webhook
- {{- with .Values.webhook.image }}
- image: "{{- if .registry -}}{{ .registry }}/{{- end -}}{{ .repository }}{{- if (.digest) -}} @{{ .digest }}{{- else -}}:{{ default $.Chart.AppVersion .tag }} {{- end -}}"
- {{- end }}
+ image: "{{ template "image" (tuple .Values.webhook.image $.Chart.AppVersion) }}"
imagePullPolicy: {{ .Values.webhook.image.pullPolicy }}
args:
- {{- if .Values.global.logLevel }}
+ {{- /* The if statement below is equivalent to {{- if $value }} but will also return true for 0. */ -}}
+ {{- if not (has (quote .Values.global.logLevel) (list "" (quote ""))) }}
- --v={{ .Values.global.logLevel }}
{{- end }}
{{- if .Values.webhook.config }}
@@ -71,8 +92,8 @@
{{ if not $config.securePort -}}
- --secure-port={{ .Values.webhook.securePort }}
{{- end }}
- {{- if .Values.featureGates }}
- - --feature-gates={{ .Values.featureGates }}
+ {{- if .Values.webhook.featureGates }}
+ - --feature-gates={{ .Values.webhook.featureGates }}
{{- end }}
{{- $tlsConfig := default $config.tlsConfig "" }}
{{ if or (not $config.tlsConfig) (and (not $tlsConfig.dynamic) (not $tlsConfig.filesystem) ) -}}
@@ -88,6 +109,9 @@
{{- with .Values.webhook.extraArgs }}
{{- toYaml . | nindent 10 }}
{{- end }}
+ {{- if not .Values.prometheus.enabled }}
+ - --metrics-listen-address=0
+ {{- end }}
ports:
- name: https
protocol: TCP
@@ -105,6 +129,11 @@
{{- else }}
containerPort: 6080
{{- end }}
+ {{- if .Values.prometheus.enabled }}
+ - containerPort: 9402
+ name: http-metrics
+ protocol: TCP
+ {{- end }}
livenessProbe:
httpGet:
path: /livez
@@ -142,6 +171,9 @@
valueFrom:
fieldRef:
fieldPath: metadata.namespace
+ {{- with .Values.webhook.extraEnv }}
+ {{- toYaml . | nindent 10 }}
+ {{- end }}
{{- with .Values.webhook.resources }}
resources:
{{- toYaml . | nindent 12 }}
@@ -152,8 +184,8 @@
- name: config
mountPath: /var/cert-manager/config
{{- end }}
- {{- if .Values.webhook.volumeMounts }}
- {{- toYaml .Values.webhook.volumeMounts | nindent 12 }}
+ {{- with .Values.webhook.volumeMounts }}
+ {{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
{{- with .Values.webhook.nodeSelector }}
@@ -179,7 +211,7 @@
configMap:
name: {{ include "webhook.fullname" . }}
{{- end }}
- {{- if .Values.webhook.volumes }}
- {{- toYaml .Values.webhook.volumes | nindent 8 }}
+ {{- with .Values.webhook.volumes }}
+ {{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}