Skip to content

Commit

Permalink
Add hypernodes validation webhook configuration yaml
Browse files Browse the repository at this point in the history
Signed-off-by: jessestutler <chenzicong4@huawei.com>
  • Loading branch information
JesseStutler committed Jan 19, 2025
1 parent 4c100b1 commit 87aaba5
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 2 deletions.
1 change: 1 addition & 0 deletions cmd/webhook-manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (
"volcano.sh/volcano/cmd/webhook-manager/app"
"volcano.sh/volcano/cmd/webhook-manager/app/options"
"volcano.sh/volcano/pkg/version"
_ "volcano.sh/volcano/pkg/webhooks/admission/hypernodes/validate"
_ "volcano.sh/volcano/pkg/webhooks/admission/jobs/mutate"
_ "volcano.sh/volcano/pkg/webhooks/admission/jobs/validate"
_ "volcano.sh/volcano/pkg/webhooks/admission/podgroups/mutate"
Expand Down
36 changes: 36 additions & 0 deletions installer/helm/chart/volcano/templates/webhooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -339,4 +339,40 @@ webhooks:
sideEffects: NoneOnDryRun
timeoutSeconds: 10
{{- end }}

{{- if .Values.custom.enabled_admissions | regexMatch "/hypernodes/validate" }}
---
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
name: volcano-admission-service-hypernodes-validate
{{- if .Values.custom.common_labels }}
labels:
{{- toYaml .Values.custom.common_labels | nindent 4 }}
{{- end }}
webhooks:
- admissionReviewVersions:
- v1
clientConfig:
service:
name: {{ .Release.Name }}-admission-service
namespace: {{ .Release.Namespace }}
path: /hypernodes/validate
port: 443
failurePolicy: Fail
matchPolicy: Equivalent
name: validatehypernodes.volcano.sh
rules:
- apiGroups:
- topology.volcano.sh
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- hypernodes
sideEffects: None
timeoutSeconds: 10
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion installer/helm/chart/volcano/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ custom:
scheduler_kube_api_burst: 2000
scheduler_schedule_period: 1s
scheduler_node_worker_threads: 20
enabled_admissions: "/jobs/mutate,/jobs/validate,/podgroups/mutate,/pods/validate,/pods/mutate,/queues/mutate,/queues/validate"
enabled_admissions: "/jobs/mutate,/jobs/validate,/podgroups/mutate,/pods/validate,/pods/mutate,/queues/mutate,/queues/validate,/hypernodes/validate"
colocation_enable: false

# Override the configuration for admission or scheduler.
Expand Down
32 changes: 31 additions & 1 deletion installer/volcano-development.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ spec:
priorityClassName: system-cluster-critical
containers:
- args:
- --enabled-admission=/jobs/mutate,/jobs/validate,/podgroups/mutate,/pods/validate,/pods/mutate,/queues/mutate,/queues/validate
- --enabled-admission=/jobs/mutate,/jobs/validate,/podgroups/mutate,/pods/validate,/pods/mutate,/queues/mutate,/queues/validate,/hypernodes/validate
- --tls-cert-file=/admission.local.config/certificates/tls.crt
- --tls-private-key-file=/admission.local.config/certificates/tls.key
- --ca-cert-file=/admission.local.config/certificates/ca.crt
Expand Down Expand Up @@ -5563,6 +5563,36 @@ webhooks:
sideEffects: NoneOnDryRun
timeoutSeconds: 10
---
# Source: volcano/templates/webhooks.yaml
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
name: volcano-admission-service-hypernodes-validate
webhooks:
- admissionReviewVersions:
- v1
clientConfig:
service:
name: volcano-admission-service
namespace: volcano-system
path: /hypernodes/validate
port: 443
failurePolicy: Fail
matchPolicy: Equivalent
name: validatehypernodes.volcano.sh
rules:
- apiGroups:
- topology.volcano.sh
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- hypernodes
sideEffects: None
timeoutSeconds: 10
---
# Source: jobflow/templates/flow_v1alpha1_jobflows.yaml
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down

0 comments on commit 87aaba5

Please sign in to comment.