-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Adds Rook NFS Helm chart as dependency of Slurm cluster chart - Refactors main values file to allow additional customisation - Adds cleanup job as pre-delete hook to fix uninstall behaviour
- Loading branch information
Scott Davidson
committed
Aug 11, 2023
1 parent
09d2512
commit 9979627
Showing
20 changed files
with
211 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Build artifacts from local helm install | ||
slurm-cluster-chart/Chart.lock | ||
slurm-cluster-chart/charts/ |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: v2 | ||
name: rooknfs | ||
version: 0.0.1 | ||
description: An packaged installation of Rook NFS for Kubernetes. |
Empty file.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,36 @@ | ||
{{- if .Values.enabled }} | ||
--- | ||
# A default storageclass must be present | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: nfs-default-claim | ||
namespace: rook-nfs | ||
name: {{ .Values.claimName}} | ||
namespace: {{ .Values.serverNamespace }} | ||
spec: | ||
accessModes: | ||
- ReadWriteMany | ||
resources: | ||
requests: | ||
storage: 1Gi | ||
storage: {{ .Values.storageCapacity }} | ||
--- | ||
apiVersion: nfs.rook.io/v1alpha1 | ||
kind: NFSServer | ||
metadata: | ||
name: rook-nfs | ||
namespace: rook-nfs | ||
name: {{ .Values.serverName }} | ||
namespace: {{ .Values.serverNamespace }} | ||
spec: | ||
replicas: 1 | ||
exports: | ||
- name: share1 | ||
- name: {{ .Values.shareName }} | ||
server: | ||
accessMode: ReadWrite | ||
squash: "none" | ||
# A Persistent Volume Claim must be created before creating NFS CRD instance. | ||
persistentVolumeClaim: | ||
claimName: nfs-default-claim | ||
claimName: {{ .Values.claimName }} | ||
# A key/value list of annotations | ||
annotations: | ||
rook: nfs | ||
--- | ||
{{- end }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{{- if .Values.enabled }} | ||
--- | ||
apiVersion: storage.k8s.io/v1 | ||
kind: StorageClass | ||
metadata: | ||
labels: | ||
app: rook-nfs | ||
name: {{ .Values.storageClassName }} | ||
parameters: | ||
exportName: {{ .Values.shareName }} | ||
nfsServerName: {{ .Values.serverName }} | ||
nfsServerNamespace: {{ .Values.serverNamespace }} | ||
provisioner: nfs.rook.io/rook-nfs-provisioner | ||
reclaimPolicy: Delete | ||
volumeBindingMode: Immediate | ||
--- | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Global flag for enabling/disabling all chart resources | ||
# This is useful for allowing charts which use this chart | ||
# as a dependency to toggle usage of this chart based on | ||
# values in the parent chart | ||
enabled: true | ||
|
||
# Name for the NFSServer resource created by rook | ||
serverName: rook-nfs | ||
|
||
# Name for the created storage class | ||
storageClassName: rook-nfs | ||
|
||
# Name for the Read-Write-Once backing PVC created by Rook | ||
claimName: rook-nfs-backing-pv | ||
|
||
# Name for the NFS share within the NFS Resource instance | ||
shareName: share-1 | ||
|
||
# Size of the Read-Write-Once backing storage volume | ||
storageCapacity: 10Gi | ||
|
||
# Image to use for the Rook NFS operator | ||
operatorImage: rook/nfs:master | ||
|
||
# NOTE: For some reason deploying everything in the default | ||
# namespace leads to R-W-M PVCs getting stuck in 'pending' | ||
# state indefinitely, so here we separate out namespaces as | ||
# of various components in the same way as the Rook docs | ||
serverNamespace: rook-nfs | ||
systemNamespace: rook-nfs-system |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{{- if .Values.rooknfs.enabled }} | ||
# NOTE: The cleanup jobs defined here are required to ensure that things which | ||
# Rook NFS is responsible for cleaning up are deleted before deleting the Rook | ||
# pods which do the actual clean up of NFS resources. For example, the RWM PVC | ||
# must be deleted before the Rook StorageClass and provisioner pod. However, | ||
# the PVC cannot be deleted until the pods which are using it are deleted, so | ||
# the various Slurm node pods must actually be the first resources deleted. | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: rook-nfs-cleanup | ||
--- | ||
# TODO: Create a job-specific ClusterRole for the ServiceAccount | ||
# instead of using the cluster-admin role here | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: rook-nfs-cleanup | ||
subjects: | ||
- kind: ServiceAccount | ||
name: rook-nfs-cleanup | ||
namespace: {{ .Release.Namespace }} | ||
roleRef: | ||
kind: ClusterRole | ||
name: cluster-admin | ||
--- | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: rook-nfs-pre-delete-cleanup | ||
annotations: | ||
"helm.sh/hook": pre-delete | ||
"helm.sh/hook-delete-policy": hook-succeeded | ||
spec: | ||
template: | ||
metadata: | ||
name: rook-nfs-pre-delete-cleanup | ||
spec: | ||
serviceAccountName: rook-nfs-cleanup | ||
containers: | ||
- name: tester | ||
image: bitnami/kubectl | ||
command: | ||
- "bin/bash" | ||
- "-c" | ||
- | | ||
kubectl delete -n {{ .Release.Namespace }} deployment {{ .Values.login.name }} --wait --cascade=foreground | ||
kubectl delete -n {{ .Release.Namespace }} statefulset {{ .Values.slurmctld.name }} --wait --cascade=foreground | ||
kubectl delete -n {{ .Release.Namespace }} statefulset {{ .Values.slurmd.name }} --wait --cascade=foreground | ||
kubectl delete -n {{ .Release.Namespace }} pvc {{ .Values.storage.claimName }} --wait | ||
kubectl delete -n {{ .Values.rooknfs.serverNamespace }} nfsservers {{ .Values.rooknfs.serverName }} --wait | ||
restartPolicy: Never | ||
--- | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{{- if .Values.rooknfs.enabled }} | ||
--- | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: {{ .Values.storage.claimName }} | ||
spec: | ||
storageClassName: {{ .Values.storageClassName }} | ||
accessModes: | ||
- ReadWriteMany | ||
resources: | ||
requests: | ||
storage: {{ .Values.storage.capacity }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.