Skip to content

Commit ae08235

Browse files
feat: add nodesets specific authcred config
Co-authored-by: Fagani Hajizada <[email protected]>
1 parent 9936bc8 commit ae08235

File tree

4 files changed

+35
-10
lines changed

4 files changed

+35
-10
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ All notable changes to this project will be documented in this file.
66

77
### Added
88

9+
- Added NodeSet level authcred configuration.
10+
911
### Fixed
1012

1113
- Fixed token job `ttlSecondsAfterFinished` being too low for helm

helm/slurm/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ Helm Chart for Slurm HPC Workload Manager
3737
| compute.image.repository | string | `"ghcr.io/slinkyproject/slurmd"` | Set the image repository to use. |
3838
| compute.image.tag | string | `"25.05-ubuntu24.04"` | Set the image tag to use. |
3939
| compute.imagePullPolicy | string | `"IfNotPresent"` | Set the image pull policy. |
40-
| compute.nodesets | list | `[{"affinity":{},"enabled":true,"extraVolumeMounts":[],"extraVolumes":[],"image":{"repository":"","tag":""},"imagePullPolicy":"IfNotPresent","name":"debug","nodeConfig":{},"nodeSelector":{"kubernetes.io/os":"linux"},"partition":{"config":{"MaxTime":"UNLIMITED","State":"UP"},"enabled":true},"persistentVolumeClaimRetentionPolicy":{"whenDeleted":"Retain","whenScaled":"Retain"},"priorityClassName":"","replicas":1,"resources":{},"tolerations":[],"updateStrategy":{"rollingUpdate":{"maxUnavailable":"20%"},"type":"RollingUpdate"},"useResourceLimits":true,"volumeClaimTemplates":[]}]` | Slurm NodeSets by object list. |
41-
| compute.nodesets[0] | string | `{"affinity":{},"enabled":true,"extraVolumeMounts":[],"extraVolumes":[],"image":{"repository":"","tag":""},"imagePullPolicy":"IfNotPresent","name":"debug","nodeConfig":{},"nodeSelector":{"kubernetes.io/os":"linux"},"partition":{"config":{"MaxTime":"UNLIMITED","State":"UP"},"enabled":true},"persistentVolumeClaimRetentionPolicy":{"whenDeleted":"Retain","whenScaled":"Retain"},"priorityClassName":"","replicas":1,"resources":{},"tolerations":[],"updateStrategy":{"rollingUpdate":{"maxUnavailable":"20%"},"type":"RollingUpdate"},"useResourceLimits":true,"volumeClaimTemplates":[]}` | Name of NodeSet. Must be unique. |
40+
| compute.nodesets | list | `[{"affinity":{},"authcred":{},"enabled":true,"extraVolumeMounts":[],"extraVolumes":[],"image":{"repository":"","tag":""},"imagePullPolicy":"IfNotPresent","name":"debug","nodeConfig":{},"nodeSelector":{"kubernetes.io/os":"linux"},"partition":{"config":{"MaxTime":"UNLIMITED","State":"UP"},"enabled":true},"persistentVolumeClaimRetentionPolicy":{"whenDeleted":"Retain","whenScaled":"Retain"},"priorityClassName":"","replicas":1,"resources":{},"tolerations":[],"updateStrategy":{"rollingUpdate":{"maxUnavailable":"20%"},"type":"RollingUpdate"},"useResourceLimits":true,"volumeClaimTemplates":[]}]` | Slurm NodeSets by object list. |
41+
| compute.nodesets[0] | string | `{"affinity":{},"authcred":{},"enabled":true,"extraVolumeMounts":[],"extraVolumes":[],"image":{"repository":"","tag":""},"imagePullPolicy":"IfNotPresent","name":"debug","nodeConfig":{},"nodeSelector":{"kubernetes.io/os":"linux"},"partition":{"config":{"MaxTime":"UNLIMITED","State":"UP"},"enabled":true},"persistentVolumeClaimRetentionPolicy":{"whenDeleted":"Retain","whenScaled":"Retain"},"priorityClassName":"","replicas":1,"resources":{},"tolerations":[],"updateStrategy":{"rollingUpdate":{"maxUnavailable":"20%"},"type":"RollingUpdate"},"useResourceLimits":true,"volumeClaimTemplates":[]}` | Name of NodeSet. Must be unique. |
4242
| compute.nodesets[0].affinity | object | `{}` | Set affinity for Kubernetes Pod scheduling. Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity |
43+
| compute.nodesets[0].authcred | object | `{}` | NodeSet specific authcred configuration, otherwise global authcred is used. |
4344
| compute.nodesets[0].enabled | bool | `true` | Enables the NodeSet in Slurm. |
4445
| compute.nodesets[0].extraVolumeMounts | list | `[]` | List of volume mounts. Ref: https://kubernetes.io/docs/concepts/storage/volumes/ |
4546
| compute.nodesets[0].extraVolumes | list | `[]` | Define list of pod volumes. Ref: https://kubernetes.io/docs/concepts/storage/volumes/ |

helm/slurm/templates/compute/compute-nodeset.yaml

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,19 @@ SPDX-License-Identifier: Apache-2.0
99
{{- $tag := $nodeset.image.tag | default (include "slurm.compute.image.tag" $) }}
1010
{{- $imageRef := printf "%s:%s" $repository $tag }}
1111
{{- $name := printf "%s-%s" (include "slurm.compute.name" $) $nodeset.name }}
12+
{{- $authcredRepository := include "slurm.authcred.image.repository" $ }}
13+
{{- $authcredTag := include "slurm.authcred.image.repository" $ }}
14+
{{- $authcredImagePullPolicy := $nodeset.imagePullPolicy | default (include "slurm.imagePullPolicy" $) }}
15+
{{- $authcredResources := $.Values.authcred.resources }}
16+
{{- with $nodeset.authcred -}}
17+
{{- with .image -}}
18+
{{- $authcredRepository = .repository | default $authcredRepository -}}
19+
{{- $authcredTag = .tag | default $authcredTag -}}
20+
{{- end -}}
21+
{{- $authcredImagePullPolicy = .imagePullPolicy | default $authcredImagePullPolicy -}}
22+
{{- $authcredResources = .resources | default $authcredResources -}}
23+
{{- end -}}
24+
{{- $authcredImageRef := printf "%s:%s" $authcredRepository $authcredTag }}
1225
---
1326
apiVersion: slinky.slurm.net/v1alpha1
1427
kind: NodeSet
@@ -50,12 +63,12 @@ spec:
5063
{{- include "slurm.imagePullSecrets" $ | nindent 6 }}
5164
initContainers:
5265
- name: init
53-
image: {{ include "slurm.authcred.imageRef" $ }}
54-
imagePullPolicy: {{ $.Values.authcred.imagePullPolicy | default (include "slurm.imagePullPolicy" $) }}
55-
{{- with $.Values.authcred.resources }}
66+
image: {{ $authcredImageRef }}
67+
imagePullPolicy: {{ $authcredImagePullPolicy }}
68+
{{- with $authcredResources }}
5669
resources:
5770
{{- toYaml . | nindent 12 }}
58-
{{- end }}{{- /* with .Values.authcred.resources */}}
71+
{{- end }}{{- /* with $authcredResources */}}
5972
env:
6073
- name: SLURM_USER
6174
value: {{ include "slurm.user" $ }}
@@ -72,8 +85,8 @@ spec:
7285
volumeMounts:
7386
{{- include "slurm.init.volumeMounts" $ | nindent 12 }}
7487
- name: logfile
75-
image: {{ include "slurm.authcred.imageRef" $ }}
76-
imagePullPolicy: {{ $.Values.authcred.imagePullPolicy | default (include "slurm.imagePullPolicy" $) }}
88+
image: {{ $authcredImageRef }}
89+
imagePullPolicy: {{ $authcredImagePullPolicy }}
7790
restartPolicy: Always
7891
env:
7992
- name: SOCKET
@@ -88,10 +101,10 @@ spec:
88101
{{- range $.Files.Lines "scripts/socket-logger.sh" }}
89102
{{ . }}
90103
{{- end }}{{- /* range $.Files.Lines "scripts/socket-logger.sh" */}}
91-
{{- with $.Values.authcred.resources }}
104+
{{- with $authcredResources }}
92105
resources:
93106
{{- toYaml . | nindent 12 }}
94-
{{- end }}{{- /* with $.Values.authcred.resources */}}
107+
{{- end }}{{- /* with $authcredResources */}}
95108
volumeMounts:
96109
- name: slurm-log
97110
mountPath: /var/log/slurm

helm/slurm/values.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,15 @@ compute:
512512
# Set the image tag to use.
513513
tag: ""
514514
#
515+
# -- (object)
516+
# NodeSet specific authcred configuration, otherwise global authcred is used.
517+
authcred: {}
518+
# imagePullPolicy: IfNotPresent
519+
# image:
520+
# repository: ghcr.io/slinkyproject/sackd
521+
# tag: 25.05-ubuntu24.04
522+
# resources: {}
523+
#
515524
# -- (string)
516525
# Set the priority class to use.
517526
# Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/#priorityclass

0 commit comments

Comments
 (0)