Skip to content

Commit aa04cf4

Browse files
authored
Update MutatingWebhookConfiguration: Switch from objectSelector to AdmissionWebhookMatchConditions (#2241)
Signed-off-by: lianghao208 <[email protected]>
1 parent 59af784 commit aa04cf4

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

manifests/v1beta1/components/controller/controller.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ spec:
1515
metadata:
1616
labels:
1717
katib.kubeflow.org/component: controller
18-
katib.kubeflow.org/metrics-collector-injection: disabled
1918
annotations:
2019
prometheus.io/scrape: "true"
2120
prometheus.io/port: "8080"

manifests/v1beta1/components/webhook/webhooks.yaml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,9 @@ webhooks:
6060
namespaceSelector:
6161
matchLabels:
6262
katib.kubeflow.org/metrics-collector-injection: enabled
63-
# Once the AdmissionWebhookMatchConditions feature gate is enabled by default, we should switch to control based on userInfo.
64-
# REF:
65-
# - AdmissionWebhookMatchConditions: https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#matching-requests-matchconditions
66-
# - Tracking issue: https://github.com/kubeflow/katib/issues/2206
67-
objectSelector:
68-
matchExpressions:
69-
- key: katib.kubeflow.org/metrics-collector-injection
70-
operator: NotIn
71-
values:
72-
- disabled
63+
matchConditions:
64+
- name: 'exclude-katib-controller'
65+
expression: 'request.userInfo.username != "system:serviceaccount:kubeflow:katib-controller"'
7366
rules:
7467
- apiGroups:
7568
- ""

0 commit comments

Comments
 (0)