From 54d4ba62ef6e3651e18ee2aa8e2665badef7f352 Mon Sep 17 00:00:00 2001 From: geoffrey1330 Date: Mon, 16 Sep 2024 17:07:58 +0100 Subject: [PATCH] added daemonset for reserve storage-node --- .../templates/caching-node-handler.yaml | 3 +- .../templates/storage-node-handler.yaml | 3 +- .../spdk-csi/templates/storage-node.yaml | 47 +++++++++++++++++++ charts/latest/spdk-csi/values.yaml | 9 +++- 4 files changed, 59 insertions(+), 3 deletions(-) diff --git a/charts/latest/spdk-csi/templates/caching-node-handler.yaml b/charts/latest/spdk-csi/templates/caching-node-handler.yaml index 1c2a17d..cfa40d3 100644 --- a/charts/latest/spdk-csi/templates/caching-node-handler.yaml +++ b/charts/latest/spdk-csi/templates/caching-node-handler.yaml @@ -24,7 +24,8 @@ spec: serviceAccountName: caching-node-service-account containers: - name: caching-node-handler - image: simplyblock/caching-node-handler + image: "{{ .Values.image.cachingNode.repository }}:{{ .Values.image.cachingNode.tag }}" + imagePullPolicy: "Always" env: - name: SPDKCSI_SECRET valueFrom: diff --git a/charts/latest/spdk-csi/templates/storage-node-handler.yaml b/charts/latest/spdk-csi/templates/storage-node-handler.yaml index b1afb40..2a5a1ad 100644 --- a/charts/latest/spdk-csi/templates/storage-node-handler.yaml +++ b/charts/latest/spdk-csi/templates/storage-node-handler.yaml @@ -24,7 +24,8 @@ spec: serviceAccountName: storage-node-service-account containers: - name: storage-node-handler - image: simplyblock/storage-node-handler + image: "{{ .Values.image.storageNode.repository }}:{{ .Values.image.storageNode.tag }}" + imagePullPolicy: "Always" env: - name: SPDKCSI_SECRET valueFrom: diff --git a/charts/latest/spdk-csi/templates/storage-node.yaml b/charts/latest/spdk-csi/templates/storage-node.yaml index 29ea349..37e58bf 100644 --- a/charts/latest/spdk-csi/templates/storage-node.yaml +++ b/charts/latest/spdk-csi/templates/storage-node.yaml @@ -77,3 +77,50 @@ spec: volumeMounts: - name: dev-vol mountPath: /dev + +--- +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: storage-node-ds-reserve + annotations: + helm.sh/hook: post-install +spec: + selector: + matchLabels: + app: storage-node-reserve + template: + metadata: + labels: + app: storage-node-reserve + spec: + serviceAccountName: storage-node-sa + nodeSelector: + type: simplyblock-storage-plane + volumes: + - name: dev-vol + hostPath: + path: /dev + hostNetwork: true + {{- if .Values.storagenode.tolerations.create }} + tolerations: + - effect: {{ .Values.storagenode.tolerations.effect }} + key: {{ .Values.storagenode.tolerations.key }} + operator: {{ .Values.storagenode.tolerations.operator }} + value: {{ .Values.storagenode.tolerations.value }} + {{- end }} + containers: + - name: s-node-api-container + image: "{{ .Values.image.simplyblock.repository }}:{{ .Values.image.simplyblock.tag }}" + imagePullPolicy: "Always" + command: ["python", "simplyblock_web/snode_app_k8s.py"] + env: + - name: HOSTNAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + securityContext: + privileged: true + volumeMounts: + - name: dev-vol + mountPath: /dev diff --git a/charts/latest/spdk-csi/values.yaml b/charts/latest/spdk-csi/values.yaml index abdb337..d837457 100644 --- a/charts/latest/spdk-csi/values.yaml +++ b/charts/latest/spdk-csi/values.yaml @@ -37,7 +37,14 @@ image: repository: simplyblock/simplyblock tag: release_v1 pullPolicy: Always - + storageNode: + repository: simplyblock/storage-node-handler + tag: latest + pullPolicy: Always + cachingNode: + repository: simplyblock/caching-node-handler + tag: latest + pullPolicy: Always serviceAccount: # Specifies whether a serviceAccount should be created create: true