blob: 76235fdee60751aa2d1f3b59f3b70566c600c07f [file] [log] [blame]
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +04001apiVersion: admissionregistration.k8s.io/v1
2kind: ValidatingWebhookConfiguration
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.validatingWebhookConfigurationAnnotations }}
14 {{- toYaml . | nindent 4 }}
15 {{- end }}
16webhooks:
17 - name: webhook.cert-manager.io
Giorgi Lekveishviliea328da2026-07-29 12:15:15 +040018 {{- with .Values.webhook.validatingWebhookConfiguration.namespaceSelector }}
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +040019 namespaceSelector:
Giorgi Lekveishviliea328da2026-07-29 12:15:15 +040020 {{- toYaml . | nindent 6 }}
21 {{- end }}
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +040022 rules:
23 - apiGroups:
24 - "cert-manager.io"
25 - "acme.cert-manager.io"
26 apiVersions:
27 - "v1"
28 operations:
29 - CREATE
30 - UPDATE
31 resources:
32 - "*/*"
33 admissionReviewVersions: ["v1"]
34 # This webhook only accepts v1 cert-manager resources.
35 # Equivalent matchPolicy ensures that non-v1 resource requests are sent to
36 # this webhook (after the resources have been converted to v1).
37 matchPolicy: Equivalent
38 timeoutSeconds: {{ .Values.webhook.timeoutSeconds }}
39 failurePolicy: Fail
40 sideEffects: None
41 clientConfig:
42 {{- if .Values.webhook.url.host }}
43 url: https://{{ .Values.webhook.url.host }}/validate
44 {{- else }}
45 service:
46 name: {{ template "webhook.fullname" . }}
47 namespace: {{ include "cert-manager.namespace" . }}
48 path: /validate
49 {{- end }}