Skip to content

Commit

Permalink
Merge pull request #394 from boozallen/#96-support-node-aff-and-tol-i…
Browse files Browse the repository at this point in the history
…n-spark-shs

#96 support node affinities and tolerations in spark history v2
  • Loading branch information
jaebchoi authored Oct 4, 2024
2 parents 70b0f50 + 30f4fc8 commit cbee16b
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 0 deletions.
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

0 comments on commit cbee16b

Please sign in to comment.