blob: 9ea29777dc341f7f46c6063f4c4023ad33217d9d [file] [log] [blame]
Giorgi Lekveishviliea328da2026-07-29 12:15:15 +04001apiVersion: admissionregistration.k8s.io/v1
2kind: MutatingWebhookConfiguration
3metadata:
4 name: {{ include "webhook.fullname" . }}
5 labels:
6 app: {{ include "webhook.name" . }}
7 app.kubernetes.io/name: {{ include "webhook.name" . }}
8 app.kubernetes.io/instance: {{ .Release.Name }}
9 app.kubernetes.io/component: "webhook"
10 {{- include "labels" . | nindent 4 }}
11 annotations:
12 cert-manager.io/inject-ca-from-secret: {{ printf "%s/%s-ca" (include "cert-manager.namespace" .) (include "webhook.fullname" .) | quote }}
13 {{- with .Values.webhook.mutatingWebhookConfigurationAnnotations }}
14 {{- toYaml . | nindent 4 }}
15 {{- end }}
16webhooks:
17 - name: webhook.cert-manager.io
18 {{- with .Values.webhook.mutatingWebhookConfiguration.namespaceSelector }}
19 namespaceSelector:
20 {{- toYaml . | nindent 6 }}
21 {{- end }}
22 rules:
23 - apiGroups:
24 - "cert-manager.io"
25 apiVersions:
26 - "v1"
27 operations:
28 - CREATE
29 resources:
30 - "certificaterequests"
31 admissionReviewVersions: ["v1"]
32 # This webhook only accepts v1 cert-manager resources.
33 # Equivalent matchPolicy ensures that non-v1 resource requests are sent to
34 # this webhook (after the resources have been converted to v1).
35 matchPolicy: Equivalent
36 timeoutSeconds: {{ .Values.webhook.timeoutSeconds }}
37 failurePolicy: Fail
38 # Only include 'sideEffects' field in Kubernetes 1.12+
39 sideEffects: None
40 clientConfig:
41 {{- if .Values.webhook.url.host }}
42 url: https://{{ .Values.webhook.url.host }}/mutate
43 {{- else }}
44 service:
45 name: {{ template "webhook.fullname" . }}
46 namespace: {{ include "cert-manager.namespace" . }}
47 path: /mutate
48 {{- end }}