From c35fab05521f732446676e863b24f29a6a4784c8 Mon Sep 17 00:00:00 2001 From: "rongfu.leng" Date: Thu, 26 Sep 2024 10:54:01 +0800 Subject: [PATCH] in webhook add match condition by scheduler name filter pod resources Signed-off-by: rongfu.leng --- installer/helm/chart/volcano/templates/webhooks.yaml | 10 ++++++++-- installer/volcano-development.yaml | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/installer/helm/chart/volcano/templates/webhooks.yaml b/installer/helm/chart/volcano/templates/webhooks.yaml index a6fbf5d995..375e8db282 100644 --- a/installer/helm/chart/volcano/templates/webhooks.yaml +++ b/installer/helm/chart/volcano/templates/webhooks.yaml @@ -18,7 +18,7 @@ webhooks: namespace: {{ .Release.Namespace }} path: /pods/mutate port: 443 - failurePolicy: Fail + failurePolicy: Ignore matchPolicy: Equivalent name: mutatepod.volcano.sh namespaceSelector: @@ -33,6 +33,9 @@ webhooks: {{- end }} objectSelector: {} reinvocationPolicy: Never + matchConditions: + - expression: object.spec.schedulerName == 'volcano' + name: scheduler-name-match rules: - apiGroups: - "" @@ -262,7 +265,7 @@ webhooks: namespace: {{ .Release.Namespace }} path: /pods/validate port: 443 - failurePolicy: Fail + failurePolicy: Ignore matchPolicy: Equivalent name: validatepod.volcano.sh namespaceSelector: @@ -276,6 +279,9 @@ webhooks: {{- toYaml .Values.custom.webhooks_namespace_selector_expressions | nindent 8 }} {{- end }} objectSelector: {} + matchConditions: + - expression: object.spec.schedulerName == 'volcano' + name: scheduler-name-match rules: - apiGroups: - "" diff --git a/installer/volcano-development.yaml b/installer/volcano-development.yaml index 6ebe086dce..9816778eef 100644 --- a/installer/volcano-development.yaml +++ b/installer/volcano-development.yaml @@ -5032,7 +5032,7 @@ webhooks: namespace: volcano-system path: /pods/mutate port: 443 - failurePolicy: Fail + failurePolicy: Ignore matchPolicy: Equivalent name: mutatepod.volcano.sh namespaceSelector: @@ -5044,6 +5044,9 @@ webhooks: - kube-system objectSelector: {} reinvocationPolicy: Never + matchConditions: + - expression: object.spec.schedulerName == 'volcano' + name: scheduler-name-match rules: - apiGroups: - "" @@ -5227,7 +5230,7 @@ webhooks: namespace: volcano-system path: /pods/validate port: 443 - failurePolicy: Fail + failurePolicy: Ignore matchPolicy: Equivalent name: validatepod.volcano.sh namespaceSelector: @@ -5238,6 +5241,9 @@ webhooks: - volcano-system - kube-system objectSelector: {} + matchConditions: + - expression: object.spec.schedulerName == 'volcano' + name: scheduler-name-match rules: - apiGroups: - ""