144 lines
5.4 KiB
YAML
144 lines
5.4 KiB
YAML
kind: DaemonSet
|
|
apiVersion: apps/v1
|
|
metadata:
|
|
name: {{ template "cstor.fullname" . }}-csi-node
|
|
{{- with .Values.csiNode.annotations }}
|
|
annotations: {{ toYaml . | nindent 4 }}
|
|
{{- end }}
|
|
labels:
|
|
{{- include "cstor.csiNode.labels" . | nindent 4 }}
|
|
spec:
|
|
selector:
|
|
matchLabels:
|
|
{{- include "cstor.csiNode.matchLabels" . | nindent 6 }}
|
|
template:
|
|
metadata:
|
|
labels:
|
|
{{- include "cstor.csiNode.labels" . | nindent 8 }}
|
|
{{- if .Values.csiNode.podLabels }}
|
|
{{ toYaml .Values.csiNode.podLabels | nindent 8 }}
|
|
{{- end }}
|
|
spec:
|
|
priorityClassName: {{ template "cstor.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/cstor.csi.openebs.io /registration/cstor.csi.openebs.io-reg.sock"]
|
|
env:
|
|
- name: ADDRESS
|
|
value: /plugin/csi.sock
|
|
- name: DRIVER_REG_SOCK_PATH
|
|
value: {{ .Values.csiNode.kubeletDir }}plugins/cstor.csi.openebs.io/csi.sock
|
|
- name: KUBE_NODE_NAME
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: spec.nodeName
|
|
- name: NODE_DRIVER
|
|
value: openebs-cstor-csi
|
|
volumeMounts:
|
|
- name: plugin-dir
|
|
mountPath: /plugin
|
|
- name: registration-dir
|
|
mountPath: /registration
|
|
- name: {{ .Values.cstorCSIPlugin.name }}
|
|
securityContext:
|
|
privileged: true
|
|
allowPrivilegeEscalation: true
|
|
image: "{{ .Values.cstorCSIPlugin.image.registry }}{{ .Values.cstorCSIPlugin.image.repository }}:{{ .Values.cstorCSIPlugin.image.tag }}"
|
|
imagePullPolicy: {{ .Values.cstorCSIPlugin.image.pullPolicy }}
|
|
args:
|
|
- "--nodeid=$(OPENEBS_NODE_ID)"
|
|
- "--endpoint=$(OPENEBS_CSI_ENDPOINT)"
|
|
- "--url=$(OPENEBS_CSI_API_URL)"
|
|
- "--plugin=$(OPENEBS_NODE_DRIVER)"
|
|
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 cstor operator components
|
|
# has been installed
|
|
- name: OPENEBS_NAMESPACE
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: metadata.namespace
|
|
# Enable/Disable auto-remount feature, when volumes
|
|
# recovers from the read-only state
|
|
- name: REMOUNT
|
|
value: "{{ .Values.cstorCSIPlugin.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
|
|
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/cstor.csi.openebs.io/
|
|
type: DirectoryOrCreate
|
|
- name: pods-mount-dir
|
|
hostPath:
|
|
path: {{ .Values.csiNode.kubeletDir }}
|
|
type: Directory
|
|
- name: chroot-iscsiadm
|
|
configMap:
|
|
defaultMode: 0555
|
|
name: openebs-cstor-csi-iscsiadm
|
|
- name: host-root
|
|
hostPath:
|
|
path: /
|
|
type: Directory
|
|
{{- if .Values.imagePullSecrets }}
|
|
imagePullSecrets:
|
|
{{ toYaml .Values.imagePullSecrets | indent 2 }}
|
|
{{- 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 }}
|