forked from saharsh-samples/openshift-admission-webhook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ns-webhook-config.yaml
39 lines (39 loc) · 974 Bytes
/
ns-webhook-config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
apiVersion: v1
kind: Template
parameters:
- name: WEBHOOK_NAME
required: true
description: Name of webhook to deploy
- name: WEBHOOK_NAMESPACE
required: true
description: Name of namespace where webhook is being deployed
objects:
- apiVersion: admissionregistration.k8s.io/v1beta1
kind: MutatingWebhookConfiguration
metadata:
labels:
webhook: ${WEBHOOK_NAME}
annotations:
service.beta.openshift.io/inject-cabundle: "true"
name: ${WEBHOOK_NAME}-namespaces
webhooks:
- name: ${WEBHOOK_NAME}-namespaces.admission.online.openshift.io
failurePolicy: Fail
namespaceSelector:
matchLabels:
special.compliance.enabled: "true"
rules:
- operations:
- CREATE
- UPDATE
apiGroups:
- "*"
apiVersions:
- "*"
resources:
- namespaces
clientConfig:
service:
name: ${WEBHOOK_NAME}
namespace: ${WEBHOOK_NAMESPACE}
path: /admissions/namespaces