| Giorgi Lekveishvili | d1234c1 | 2023-06-19 10:37:06 +0400 | [diff] [blame] | 1 | apiVersion: admissionregistration.k8s.io/v1 |
| 2 | kind: MutatingWebhookConfiguration |
| 3 | metadata: |
| 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 }} |
| 16 | webhooks: |
| 17 | - name: webhook.cert-manager.io |
| gio | 33d6293 | 2026-07-23 16:39:35 +0400 | [diff] [blame^] | 18 | {{- with .Values.webhook.mutatingWebhookConfiguration.namespaceSelector }} |
| 19 | namespaceSelector: |
| 20 | {{- toYaml . | nindent 6 }} |
| 21 | {{- end }} |
| Giorgi Lekveishvili | d1234c1 | 2023-06-19 10:37:06 +0400 | [diff] [blame] | 22 | rules: |
| 23 | - apiGroups: |
| 24 | - "cert-manager.io" |
| Giorgi Lekveishvili | d1234c1 | 2023-06-19 10:37:06 +0400 | [diff] [blame] | 25 | apiVersions: |
| 26 | - "v1" |
| 27 | operations: |
| 28 | - CREATE |
| Giorgi Lekveishvili | d1234c1 | 2023-06-19 10:37:06 +0400 | [diff] [blame] | 29 | resources: |
| gio | 33d6293 | 2026-07-23 16:39:35 +0400 | [diff] [blame^] | 30 | - "certificaterequests" |
| Giorgi Lekveishvili | d1234c1 | 2023-06-19 10:37:06 +0400 | [diff] [blame] | 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 |
| gio | 33d6293 | 2026-07-23 16:39:35 +0400 | [diff] [blame^] | 48 | {{- end }} |