Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#96 support node affinities and tolerations in spark history v2 #394

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ _**NOTE:**_ *the version should match the aiSSEMBLE project version.*
| deployment.envFromSecret | Environment variables to pull from a Secret. Format: <br/>`ENV_VAR.secretName: k8s_secret_name`<br/>`ENV_VAR.key: k8s_secret_key` | {} |
| deployment.volumes | Volumes to attach to the Spark History Server Deployment. | [] |
| deployment.volumeMounts | Volume mounts to attach to the Spark History Server Deployment. | [] |
| deployment.affinity | Node Affinity rule to constrain which nodes your Pod can be scheduled on based on node labels. | {} | |
| deployment.tolerations | Tolerations rule to ensure that pods are not scheduled onto inappropriate nodes. | [] |
| dependencies.packages | List of packages to install in the Spark History Server Deployment. | [] |
| dependencies.jars | List of jars to install in the Spark History Server Deployment. | [] |
| ingress.enabled | Enable or disable the Spark History Server Ingress. | true |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ spec:
{{ toYaml .Values.deployment.labels }}
{{- end }}
spec:
{{- if .Values.deployment.affinity }}
affinity:
{{- toYaml .Values.deployment.affinity | nindent 8 }}
{{- end }}
{{- if or (not (empty .Values.dependencies.packages)) (not (empty .Values.dependencies.jars)) }}
initContainers:
- name: "populate-jar-volume"
Expand Down Expand Up @@ -120,4 +124,8 @@ spec:
{{- if .Values.deployment.volumes }}
{{- toYaml .Values.deployment.volumes }}
{{- end }}
{{- if .Values.deployment.tolerations }}
tolerations:
{{- toYaml .Values.deployment.tolerations | nindent 8 }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -378,3 +378,41 @@ tests:
- equal:
path: spec.template.spec.containers[0].ports[0].name
value: "port-name"

- it: When specifying tolerations, the appropriate tolerations are configured
set:
deployment.tolerations:
- key: "node.kubernetes.io/not-ready-test"
operator: "Exists"
effect: "NoSchedule"
asserts:
- contains:
path: spec.template.spec.tolerations
any: true
content:
key: "node.kubernetes.io/not-ready-test"
operator: "Exists"
effect: "NoSchedule"

- it: When specifying node affinities, the appropriate affinities are configured
set:
deployment.affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/arch
operator: In
values:
- arm64
asserts:
- contains:
path: spec.template.spec.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms
any: true
content:
matchExpressions:
- key: kubernetes.io/arch
operator: In
values:
- arm64

Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ deployment:
envFromSecret: {}
volumes: []
volumeMounts: []
tolerations: []
affinity: {}

dependencies:
packages: []
Expand Down