Skip to content

Commit

Permalink
CARRY: Configure Kueue Pod webhooks so they do not interfere with inf…
Browse files Browse the repository at this point in the history
…ra Pods (kubernetes-sigs#10)
  • Loading branch information
VanillaSpoon authored and astefanutti committed Feb 15, 2024
1 parent a63b259 commit cb0ed33
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 0 deletions.
30 changes: 30 additions & 0 deletions config/components/webhook/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,33 @@ resources:

configurations:
- kustomizeconfig.yaml

patches:
- patch: |-
apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
name: mutating-webhook-configuration
webhooks:
- name: mpod.kb.io
namespaceSelector:
matchExpressions:
- key: kubernetes.io/metadata.name
operator: NotIn
values:
- kube-system
- kueue-system
- patch: |-
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
name: validating-webhook-configuration
webhooks:
- name: vpod.kb.io
namespaceSelector:
matchExpressions:
- key: kubernetes.io/metadata.name
operator: NotIn
values:
- kube-system
- kueue-system
39 changes: 39 additions & 0 deletions config/components/webhook/manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,25 @@ webhooks:
resources:
- mpijobs
sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
service:
name: webhook-service
namespace: system
path: /mutate--v1-pod
failurePolicy: Fail
name: mpod.kb.io
rules:
- apiGroups:
- ""
apiVersions:
- v1
operations:
- CREATE
resources:
- pods
sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
Expand Down Expand Up @@ -419,6 +438,26 @@ webhooks:
resources:
- mpijobs
sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
service:
name: webhook-service
namespace: system
path: /validate--v1-pod
failurePolicy: Fail
name: vpod.kb.io
rules:
- apiGroups:
- ""
apiVersions:
- v1
operations:
- CREATE
- UPDATE
resources:
- pods
sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
Expand Down
2 changes: 2 additions & 0 deletions config/rhoai/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,5 @@ patches:
- path: manager_webhook_patch.yaml
- path: manager_metrics_patch.yaml
- path: auth_proxy_service_patch.yaml
- path: mutating_webhook_patch.yaml
- path: validating_webhook_patch.yaml
7 changes: 7 additions & 0 deletions config/rhoai/mutating_webhook_patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
name: mutating-webhook-configuration
webhooks:
- $patch: delete
name: mpod.kb.io
7 changes: 7 additions & 0 deletions config/rhoai/validating_webhook_patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
name: validating-webhook-configuration
webhooks:
- $patch: delete
name: vpod.kb.io

0 comments on commit cb0ed33

Please sign in to comment.