Skip to content

Commit

Permalink
Switch from objectSelector to AdmissionWebhookMatchConditions
Browse files Browse the repository at this point in the history
  • Loading branch information
lianghao208 committed Jan 14, 2025
1 parent eb8af4d commit 66a0686
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
1 change: 0 additions & 1 deletion manifests/v1beta1/components/controller/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ spec:
metadata:
labels:
katib.kubeflow.org/component: controller
katib.kubeflow.org/metrics-collector-injection: disabled
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "8080"
Expand Down
13 changes: 3 additions & 10 deletions manifests/v1beta1/components/webhook/webhooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,9 @@ webhooks:
namespaceSelector:
matchLabels:
katib.kubeflow.org/metrics-collector-injection: enabled
# Once the AdmissionWebhookMatchConditions feature gate is enabled by default, we should switch to control based on userInfo.
# REF:
# - AdmissionWebhookMatchConditions: https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#matching-requests-matchconditions
# - Tracking issue: https://github.com/kubeflow/katib/issues/2206
objectSelector:
matchExpressions:
- key: katib.kubeflow.org/metrics-collector-injection
operator: NotIn
values:
- disabled
matchConditions:
- name: 'exclude-katib-controller'
expression: 'request.userInfo.username != "system:serviceaccount:kubeflow:katib-controller"'
rules:
- apiGroups:
- ""
Expand Down

0 comments on commit 66a0686

Please sign in to comment.