2018-12-10 19:25:34 +00:00
|
|
|
kind: DaemonSet
|
|
|
|
apiVersion: apps/v1beta2
|
|
|
|
metadata:
|
|
|
|
name: {{ include "ceph-csi-rbd.nodeplugin.fullname" . }}
|
|
|
|
labels:
|
|
|
|
app: {{ include "ceph-csi-rbd.name" . }}
|
|
|
|
chart: {{ include "ceph-csi-rbd.chart" . }}
|
|
|
|
component: {{ .Values.nodeplugin.name }}
|
|
|
|
release: {{ .Release.Name }}
|
|
|
|
heritage: {{ .Release.Service }}
|
|
|
|
spec:
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
app: {{ include "ceph-csi-rbd.name" . }}
|
|
|
|
component: {{ .Values.nodeplugin.name }}
|
|
|
|
release: {{ .Release.Name }}
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
app: {{ include "ceph-csi-rbd.name" . }}
|
|
|
|
chart: {{ include "ceph-csi-rbd.chart" . }}
|
|
|
|
component: {{ .Values.nodeplugin.name }}
|
|
|
|
release: {{ .Release.Name }}
|
|
|
|
heritage: {{ .Release.Service }}
|
|
|
|
spec:
|
|
|
|
serviceAccountName: {{ include "ceph-csi-rbd.serviceAccountName.nodeplugin" . }}
|
|
|
|
hostNetwork: true
|
|
|
|
hostPID: true
|
|
|
|
# to use e.g. Rook orchestrated cluster, and mons' FQDN is
|
|
|
|
# resolved through k8s service, set dns policy to cluster first
|
|
|
|
dnsPolicy: ClusterFirstWithHostNet
|
|
|
|
containers:
|
|
|
|
- name: driver-registrar
|
|
|
|
image: "{{ .Values.nodeplugin.registrar.image.repository }}:{{ .Values.nodeplugin.registrar.image.tag }}"
|
|
|
|
args:
|
|
|
|
- "--v=5"
|
2019-02-05 21:29:16 +00:00
|
|
|
- "--csi-address=/csi/{{ .Values.socketFile }}"
|
|
|
|
- "--kubelet-registration-path={{ .Values.socketDir }}/{{ .Values.socketFile }}"
|
|
|
|
lifecycle:
|
|
|
|
preStop:
|
|
|
|
exec:
|
2019-03-13 05:09:58 +00:00
|
|
|
command: [
|
|
|
|
"/bin/sh", "-c",
|
|
|
|
'rm -rf /registration/{{ .Values.driverName }}
|
|
|
|
/registration/{{ .Values.driverName }}-reg.sock'
|
|
|
|
]
|
2018-12-10 19:25:34 +00:00
|
|
|
env:
|
|
|
|
- name: KUBE_NODE_NAME
|
|
|
|
valueFrom:
|
|
|
|
fieldRef:
|
|
|
|
fieldPath: spec.nodeName
|
2019-04-25 04:03:44 +00:00
|
|
|
imagePullPolicy: {{ .Values.nodeplugin.registrar.image.pullPolicy }}
|
2018-12-10 19:25:34 +00:00
|
|
|
volumeMounts:
|
2019-02-05 21:29:16 +00:00
|
|
|
- name: plugin-dir
|
|
|
|
mountPath: /csi
|
2018-12-10 19:25:34 +00:00
|
|
|
- name: registration-dir
|
|
|
|
mountPath: /registration
|
|
|
|
resources:
|
|
|
|
{{ toYaml .Values.nodeplugin.registrar.resources | indent 12 }}
|
|
|
|
- name: csi-rbdplugin
|
|
|
|
securityContext:
|
|
|
|
privileged: true
|
|
|
|
capabilities:
|
|
|
|
add: ["SYS_ADMIN"]
|
|
|
|
allowPrivilegeEscalation: true
|
|
|
|
image: "{{ .Values.nodeplugin.plugin.image.repository }}:{{ .Values.nodeplugin.plugin.image.tag }}"
|
|
|
|
args :
|
|
|
|
- "--nodeid=$(NODE_ID)"
|
|
|
|
- "--endpoint=$(CSI_ENDPOINT)"
|
|
|
|
- "--v=5"
|
2019-03-13 05:09:58 +00:00
|
|
|
- "--drivername=$(DRIVER_NAME)"
|
2019-01-19 01:06:32 +00:00
|
|
|
- "--containerized=true"
|
|
|
|
- "--metadatastorage=k8s_configmap"
|
2018-12-10 19:25:34 +00:00
|
|
|
env:
|
|
|
|
- name: HOST_ROOTFS
|
|
|
|
value: "/rootfs"
|
2019-03-13 05:09:58 +00:00
|
|
|
- name: DRIVER_NAME
|
|
|
|
value: {{ .Values.driverName }}
|
2018-12-10 19:25:34 +00:00
|
|
|
- name: NODE_ID
|
|
|
|
valueFrom:
|
|
|
|
fieldRef:
|
|
|
|
fieldPath: spec.nodeName
|
|
|
|
- name: CSI_ENDPOINT
|
|
|
|
value: "unix:/{{ .Values.socketDir }}/{{ .Values.socketFile }}"
|
2019-04-25 04:03:44 +00:00
|
|
|
imagePullPolicy: {{ .Values.nodeplugin.plugin.image.pullPolicy }}
|
2018-12-10 19:25:34 +00:00
|
|
|
volumeMounts:
|
|
|
|
- name: plugin-dir
|
|
|
|
mountPath: {{ .Values.socketDir }}
|
|
|
|
- name: pods-mount-dir
|
|
|
|
mountPath: /var/lib/kubelet/pods
|
|
|
|
mountPropagation: "Bidirectional"
|
2019-01-19 01:06:32 +00:00
|
|
|
- name: plugin-mount-dir
|
|
|
|
mountPath: {{ .Values.volumeDevicesDir }}
|
|
|
|
mountPropagation: "Bidirectional"
|
2018-12-10 19:25:34 +00:00
|
|
|
- mountPath: /dev
|
|
|
|
name: host-dev
|
|
|
|
- mountPath: /rootfs
|
|
|
|
name: host-rootfs
|
|
|
|
- mountPath: /sys
|
|
|
|
name: host-sys
|
|
|
|
- mountPath: /lib/modules
|
|
|
|
name: lib-modules
|
|
|
|
readOnly: true
|
|
|
|
resources:
|
|
|
|
{{ toYaml .Values.nodeplugin.plugin.resources | indent 12 }}
|
|
|
|
volumes:
|
|
|
|
- name: plugin-dir
|
|
|
|
hostPath:
|
|
|
|
path: {{ .Values.socketDir }}
|
|
|
|
type: DirectoryOrCreate
|
2019-01-19 01:06:32 +00:00
|
|
|
- name: plugin-mount-dir
|
|
|
|
hostPath:
|
|
|
|
path: {{ .Values.volumeDevicesDir }}
|
|
|
|
type: DirectoryOrCreate
|
2018-12-10 19:25:34 +00:00
|
|
|
- name: registration-dir
|
|
|
|
hostPath:
|
2019-01-19 01:06:32 +00:00
|
|
|
path: {{ .Values.registrationDir }}
|
2018-12-10 19:25:34 +00:00
|
|
|
type: Directory
|
|
|
|
- name: pods-mount-dir
|
|
|
|
hostPath:
|
|
|
|
path: /var/lib/kubelet/pods
|
|
|
|
type: Directory
|
|
|
|
- name: host-dev
|
|
|
|
hostPath:
|
|
|
|
path: /dev
|
|
|
|
- name: host-rootfs
|
|
|
|
hostPath:
|
|
|
|
path: /
|
|
|
|
- name: host-sys
|
|
|
|
hostPath:
|
|
|
|
path: /sys
|
|
|
|
- name: lib-modules
|
|
|
|
hostPath:
|
|
|
|
path: /lib/modules
|
|
|
|
{{- if .Values.nodeplugin.affinity -}}
|
|
|
|
affinity:
|
|
|
|
{{ toYaml .Values.nodeplugin.affinity . | indent 8 }}
|
|
|
|
{{- end -}}
|
|
|
|
{{- if .Values.nodeplugin.nodeSelector -}}
|
|
|
|
nodeSelector:
|
|
|
|
{{ toYaml .Values.nodeplugin.nodeSelector | indent 8 }}
|
|
|
|
{{- end -}}
|
|
|
|
{{- if .Values.nodeplugin.tolerations -}}
|
|
|
|
tolerations:
|
|
|
|
{{ toYaml .Values.nodeplugin.tolerations | indent 8 }}
|
|
|
|
{{- end -}}
|