Files
dsk-devops-toolchains/helm/openebs/charts/jiva/templates/csi-node.yaml
2024-01-03 17:29:11 +09:00

166 lines
6.6 KiB
YAML

kind: DaemonSet
apiVersion: apps/v1
metadata:
name: {{ template "jiva.fullname" . }}-csi-node
{{- with .Values.csiNode.annotations }}
annotations: {{ toYaml . | nindent 4 }}
{{- end }}
labels:
{{- include "jiva.csiNode.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "jiva.csiNode.matchLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "jiva.csiNode.labels" . | nindent 8 }}
{{- if .Values.csiNode.podLabels }}
{{ toYaml .Values.csiNode.podLabels | nindent 8 }}
{{- end }}
spec:
priorityClassName: {{ template "jiva.csiNode.priorityClassName" . }}
serviceAccountName: {{ .Values.serviceAccount.csiNode.name }}
hostNetwork: true
containers:
- name: {{ .Values.csiNode.driverRegistrar.name }}
image: "{{ .Values.csiNode.driverRegistrar.image.registry }}{{ .Values.csiNode.driverRegistrar.image.repository }}:{{ .Values.csiNode.driverRegistrar.image.tag }}"
imagePullPolicy: {{ .Values.csiNode.driverRegistrar.image.pullPolicy }}
resources:
{{ toYaml .Values.csiNode.resources | indent 12 }}
args:
- "--v={{ .Values.csiNode.driverRegistrar.logLevel | default .Values.csiNode.logLevel }}"
- "--csi-address=$(ADDRESS)"
- "--kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)"
lifecycle:
preStop:
exec:
command: ["/bin/sh", "-c", "rm -rf /registration/jiva.csi.openebs.io /registration/jiva.csi.openebs.io-reg.sock"]
env:
- name: ADDRESS
value: /plugin/csi.sock
- name: DRIVER_REG_SOCK_PATH
value: {{ .Values.csiNode.kubeletDir }}plugins/jiva.csi.openebs.io/csi.sock
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: NODE_DRIVER
value: openebs-jiva-csi
volumeMounts:
- name: plugin-dir
mountPath: /plugin
- name: registration-dir
mountPath: /registration
- name: {{ .Values.jivaCSIPlugin.name }}
securityContext:
privileged: true
allowPrivilegeEscalation: true
image: "{{ .Values.jivaCSIPlugin.image.registry }}{{ .Values.jivaCSIPlugin.image.repository }}:{{ .Values.jivaCSIPlugin.image.tag }}"
imagePullPolicy: {{ .Values.jivaCSIPlugin.image.pullPolicy }}
args:
- "--name=jiva.csi.openebs.io"
- "--nodeid=$(OPENEBS_NODE_ID)"
- "--endpoint=$(OPENEBS_CSI_ENDPOINT)"
- "--plugin=$(OPENEBS_NODE_DRIVER)"
# enableiscsidebug is used to enable debug logs for iscsi operations
- "--enableiscsidebug=true"
# logging level for klog library used in k8s packages
#- "--v=5"
# retrycount is the max number of retries per nodeStaging rpc
# request on a timeout of 5 sec
# This count has been set to 20 for sanity test cases as it takes
# time in minikube
- "--retrycount=20"
# metricsBindAddress is the TCP address that the controller should bind to
# for serving prometheus metrics. By default the address is set to localhost:9505.
# The address can be configured to any desired address.
# Remove the flag to disable prometheus metrics.
- "--metricsBindAddress=:9505"
env:
- name: OPENEBS_NODE_ID
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: OPENEBS_CSI_ENDPOINT
value: unix:///plugin/csi.sock
- name: OPENEBS_NODE_DRIVER
value: node
- name: OPENEBS_CSI_API_URL
value: https://openebs.io
# OpenEBS namespace where the openebs jiva operator components
# has been installed
- name: OPENEBS_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
# Enable/Disable auto-remount feature, when volumes
# recovers form the read-only state
- name: REMOUNT
value: "{{ .Values.jivaCSIPlugin.remount }}"
volumeMounts:
- name: plugin-dir
mountPath: /plugin
- name: device-dir
mountPath: /dev
- name: pods-mount-dir
mountPath: {{ .Values.csiNode.kubeletDir }}
# needed so that any mounts setup inside this container are
# propagated back to the host machine.
mountPropagation: "Bidirectional"
- name: host-root
mountPath: /host
mountPropagation: "HostToContainer"
- name: chroot-iscsiadm
mountPath: /sbin/iscsiadm
subPath: iscsiadm
- name: {{ .Values.csiNode.livenessprobe.name }}
image: "{{ .Values.csiNode.livenessprobe.image.registry }}{{ .Values.csiNode.livenessprobe.image.repository }}:{{ .Values.csiNode.livenessprobe.image.tag }}"
imagePullPolicy: {{ .Values.csiNode.livenessprobe.image.pullPolicy }}
args:
- "--csi-address=/plugin/csi.sock"
volumeMounts:
- mountPath: /plugin
name: plugin-dir
volumes:
- name: device-dir
hostPath:
path: /dev
type: Directory
- name: registration-dir
hostPath:
path: {{ .Values.csiNode.kubeletDir }}plugins_registry/
type: DirectoryOrCreate
- name: plugin-dir
hostPath:
path: {{ .Values.csiNode.kubeletDir }}plugins/jiva.csi.openebs.io/
type: DirectoryOrCreate
- name: pods-mount-dir
hostPath:
path: {{ .Values.csiNode.kubeletDir }}
type: Directory
- name: chroot-iscsiadm
configMap:
defaultMode: 0555
name: openebs-jiva-csi-iscsiadm
- name: host-root
hostPath:
path: /
type: Directory
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | nindent 8 }}
{{- end }}
{{- if .Values.csiNode.nodeSelector }}
nodeSelector:
{{ toYaml .Values.csiNode.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.csiNode.securityContext }}
securityContext:
{{ toYaml .Values.csiNode.securityContext | indent 8 }}
{{- end }}
{{- if .Values.csiNode.tolerations }}
tolerations:
{{ toYaml .Values.csiNode.tolerations | indent 8 }}
{{- end }}