2019-02-21 04:30:21 +00:00
|
|
|
kind: DaemonSet
|
2019-06-19 09:05:44 +00:00
|
|
|
apiVersion: apps/v1
|
2019-02-21 04:30:21 +00:00
|
|
|
metadata:
|
|
|
|
name: {{ include "ceph-csi-cephfs.nodeplugin.fullname" . }}
|
2019-07-29 10:36:24 +00:00
|
|
|
namespace: {{ .Release.Namespace }}
|
2019-02-21 04:30:21 +00:00
|
|
|
labels:
|
|
|
|
app: {{ include "ceph-csi-cephfs.name" . }}
|
|
|
|
chart: {{ include "ceph-csi-cephfs.chart" . }}
|
|
|
|
component: {{ .Values.nodeplugin.name }}
|
|
|
|
release: {{ .Release.Name }}
|
|
|
|
heritage: {{ .Release.Service }}
|
|
|
|
spec:
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
app: {{ include "ceph-csi-cephfs.name" . }}
|
|
|
|
component: {{ .Values.nodeplugin.name }}
|
|
|
|
release: {{ .Release.Name }}
|
2020-01-02 08:48:30 +00:00
|
|
|
updateStrategy:
|
|
|
|
type: {{ .Values.nodeplugin.updateStrategy }}
|
2019-02-21 04:30:21 +00:00
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
app: {{ include "ceph-csi-cephfs.name" . }}
|
|
|
|
chart: {{ include "ceph-csi-cephfs.chart" . }}
|
|
|
|
component: {{ .Values.nodeplugin.name }}
|
|
|
|
release: {{ .Release.Name }}
|
|
|
|
heritage: {{ .Release.Service }}
|
|
|
|
spec:
|
|
|
|
serviceAccountName: {{ include "ceph-csi-cephfs.serviceAccountName.nodeplugin" . }}
|
|
|
|
hostNetwork: 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
|
2020-01-13 04:14:18 +00:00
|
|
|
# This is necessary only for systems with SELinux, where
|
|
|
|
# non-privileged sidecar containers cannot access unix domain socket
|
|
|
|
# created by privileged CSI driver container.
|
|
|
|
securityContext:
|
|
|
|
privileged: true
|
2019-02-21 04:30:21 +00:00
|
|
|
image: "{{ .Values.nodeplugin.registrar.image.repository }}:{{ .Values.nodeplugin.registrar.image.tag }}"
|
2019-09-26 09:55:12 +00:00
|
|
|
imagePullPolicy: {{ .Values.nodeplugin.registrar.image.pullPolicy }}
|
2019-02-21 04:30:21 +00:00
|
|
|
args:
|
|
|
|
- "--v=5"
|
2019-09-26 09:55:12 +00:00
|
|
|
- "--csi-address=/csi/{{ .Values.pluginSocketFile }}"
|
|
|
|
- "--kubelet-registration-path={{ .Values.socketDir }}/{{ .Values.pluginSocketFile }}"
|
2019-02-21 04:30:21 +00:00
|
|
|
lifecycle:
|
|
|
|
preStop:
|
|
|
|
exec:
|
2019-09-26 09:55:12 +00:00
|
|
|
{{- /*
|
|
|
|
NOTE(wilmardo): The replace functions ensures there are no spaces in the string.
|
|
|
|
To avoid `rm -rf /registration/driver name`
|
|
|
|
*/}}
|
|
|
|
command: [
|
|
|
|
"/bin/sh", "-c",
|
|
|
|
"rm -rf /registration/{{ .Values.driverName | replace " " "" }} \
|
|
|
|
/registration/{{ .Values.driverName | replace " " "" }}-reg.sock"
|
|
|
|
]
|
2019-02-21 04:30:21 +00:00
|
|
|
env:
|
|
|
|
- name: KUBE_NODE_NAME
|
|
|
|
valueFrom:
|
|
|
|
fieldRef:
|
|
|
|
fieldPath: spec.nodeName
|
|
|
|
volumeMounts:
|
2019-09-26 09:55:12 +00:00
|
|
|
- name: socket-dir
|
2019-02-21 04:30:21 +00:00
|
|
|
mountPath: /csi
|
|
|
|
- name: registration-dir
|
|
|
|
mountPath: /registration
|
|
|
|
resources:
|
|
|
|
{{ toYaml .Values.nodeplugin.registrar.resources | indent 12 }}
|
|
|
|
- name: csi-cephfsplugin
|
|
|
|
image: "{{ .Values.nodeplugin.plugin.image.repository }}:{{ .Values.nodeplugin.plugin.image.tag }}"
|
2019-09-26 09:55:12 +00:00
|
|
|
imagePullPolicy: {{ .Values.nodeplugin.plugin.image.pullPolicy }}
|
|
|
|
args:
|
2019-02-21 04:30:21 +00:00
|
|
|
- "--nodeid=$(NODE_ID)"
|
2019-05-24 11:03:33 +00:00
|
|
|
- "--type=cephfs"
|
2019-08-14 06:42:17 +00:00
|
|
|
- "--nodeserver=true"
|
2019-09-26 09:55:12 +00:00
|
|
|
- "--pidlimit=-1"
|
|
|
|
{{- if .Values.nodeplugin.grpcMetrics.enabled }}
|
|
|
|
- "--metricsport={{ .Values.nodeplugin.grpcMetrics.containerPort }}"
|
|
|
|
- "--metricspath=/metrics"
|
|
|
|
- "--enablegrpcmetrics=true"
|
2020-02-18 22:07:20 +00:00
|
|
|
{{- end }}
|
|
|
|
{{- if .Values.nodeplugin.forcecephkernelclient }}
|
|
|
|
- "--forcecephkernelclient={{ .Values.nodeplugin.forcecephkernelclient }}"
|
2019-09-26 09:55:12 +00:00
|
|
|
{{- end }}
|
2019-02-21 04:30:21 +00:00
|
|
|
- "--endpoint=$(CSI_ENDPOINT)"
|
|
|
|
- "--v=5"
|
2019-03-13 05:09:58 +00:00
|
|
|
- "--drivername=$(DRIVER_NAME)"
|
2019-02-21 04:30:21 +00:00
|
|
|
- "--metadatastorage=k8s_configmap"
|
2019-03-29 08:12:09 +00:00
|
|
|
- "--mountcachedir=/mount-cache-dir"
|
2019-02-21 04:30:21 +00:00
|
|
|
env:
|
2019-08-21 09:28:02 +00:00
|
|
|
- name: POD_IP
|
|
|
|
valueFrom:
|
|
|
|
fieldRef:
|
|
|
|
fieldPath: status.podIP
|
2019-03-13 05:09:58 +00:00
|
|
|
- name: DRIVER_NAME
|
|
|
|
value: {{ .Values.driverName }}
|
2019-02-21 04:30:21 +00:00
|
|
|
- name: NODE_ID
|
|
|
|
valueFrom:
|
|
|
|
fieldRef:
|
|
|
|
fieldPath: spec.nodeName
|
2019-09-26 09:55:12 +00:00
|
|
|
- name: POD_NAMESPACE
|
|
|
|
valueFrom:
|
|
|
|
fieldRef:
|
|
|
|
fieldPath: metadata.namespace
|
2019-02-21 04:30:21 +00:00
|
|
|
- name: CSI_ENDPOINT
|
2019-09-26 09:55:12 +00:00
|
|
|
value: "unix:///csi/{{ .Values.pluginSocketFile }}"
|
|
|
|
securityContext:
|
|
|
|
privileged: true
|
|
|
|
capabilities:
|
|
|
|
add: ["SYS_ADMIN"]
|
|
|
|
allowPrivilegeEscalation: true
|
2019-02-21 04:30:21 +00:00
|
|
|
volumeMounts:
|
2019-03-29 08:12:09 +00:00
|
|
|
- name: mount-cache-dir
|
|
|
|
mountPath: /mount-cache-dir
|
2019-07-03 10:02:36 +00:00
|
|
|
- name: socket-dir
|
2019-09-26 09:55:12 +00:00
|
|
|
mountPath: /csi
|
2019-07-29 10:36:24 +00:00
|
|
|
- name: mountpoint-dir
|
2019-07-03 10:02:36 +00:00
|
|
|
mountPath: /var/lib/kubelet/pods
|
2019-09-26 09:55:12 +00:00
|
|
|
mountPropagation: Bidirectional
|
|
|
|
- name: plugin-dir
|
|
|
|
mountPath: /var/lib/kubelet/plugins
|
2019-02-21 04:30:21 +00:00
|
|
|
mountPropagation: "Bidirectional"
|
|
|
|
- mountPath: /dev
|
|
|
|
name: host-dev
|
2020-01-23 08:29:53 +00:00
|
|
|
- mountPath: /run/mount
|
|
|
|
name: host-mount
|
2019-02-21 04:30:21 +00:00
|
|
|
- mountPath: /sys
|
|
|
|
name: host-sys
|
|
|
|
- mountPath: /lib/modules
|
|
|
|
name: lib-modules
|
|
|
|
readOnly: true
|
2019-05-28 19:03:18 +00:00
|
|
|
- name: ceph-csi-config
|
|
|
|
mountPath: /etc/ceph-csi-config/
|
2019-06-25 19:29:17 +00:00
|
|
|
- name: keys-tmp-dir
|
|
|
|
mountPath: /tmp/csi/keys
|
2019-02-21 04:30:21 +00:00
|
|
|
resources:
|
2019-06-20 19:30:40 +00:00
|
|
|
{{ toYaml .Values.nodeplugin.plugin.resources | indent 12 }}
|
2019-09-26 09:55:12 +00:00
|
|
|
{{- if .Values.nodeplugin.httpMetrics.enabled }}
|
2019-06-20 19:30:40 +00:00
|
|
|
- name: liveness-prometheus
|
2020-01-13 04:14:18 +00:00
|
|
|
securityContext:
|
|
|
|
privileged: true
|
2019-06-20 19:30:40 +00:00
|
|
|
image: "{{ .Values.nodeplugin.plugin.image.repository }}:{{ .Values.nodeplugin.plugin.image.tag }}"
|
2019-09-26 09:55:12 +00:00
|
|
|
imagePullPolicy: {{ .Values.nodeplugin.plugin.image.pullPolicy }}
|
2019-06-20 19:30:40 +00:00
|
|
|
args:
|
|
|
|
- "--type=liveness"
|
|
|
|
- "--endpoint=$(CSI_ENDPOINT)"
|
2019-09-26 09:55:12 +00:00
|
|
|
- "--metricsport={{ .Values.nodeplugin.httpMetrics.containerPort }}"
|
2019-08-21 09:28:02 +00:00
|
|
|
- "--metricspath=/metrics"
|
2019-06-20 19:30:40 +00:00
|
|
|
- "--polltime=60s"
|
|
|
|
- "--timeout=3s"
|
|
|
|
env:
|
|
|
|
- name: CSI_ENDPOINT
|
2019-09-26 09:55:12 +00:00
|
|
|
value: "unix:///csi/{{ .Values.pluginSocketFile }}"
|
2019-06-20 19:30:40 +00:00
|
|
|
- name: POD_IP
|
|
|
|
valueFrom:
|
|
|
|
fieldRef:
|
|
|
|
fieldPath: status.podIP
|
|
|
|
volumeMounts:
|
2019-09-26 09:55:12 +00:00
|
|
|
- name: socket-dir
|
|
|
|
mountPath: /csi
|
2019-06-20 19:30:40 +00:00
|
|
|
resources:
|
2019-02-21 04:30:21 +00:00
|
|
|
{{ toYaml .Values.nodeplugin.plugin.resources | indent 12 }}
|
2019-09-26 09:55:12 +00:00
|
|
|
{{- end }}
|
2019-02-21 04:30:21 +00:00
|
|
|
volumes:
|
2019-03-29 08:12:09 +00:00
|
|
|
- name: mount-cache-dir
|
|
|
|
emptyDir: {}
|
2019-07-03 10:02:36 +00:00
|
|
|
- name: socket-dir
|
2019-02-21 04:30:21 +00:00
|
|
|
hostPath:
|
|
|
|
path: {{ .Values.socketDir }}
|
|
|
|
type: DirectoryOrCreate
|
|
|
|
- name: registration-dir
|
|
|
|
hostPath:
|
2020-01-21 08:22:43 +00:00
|
|
|
path: {{ .Values.registrationDir }}
|
2019-02-21 04:30:21 +00:00
|
|
|
type: Directory
|
2019-07-03 10:02:36 +00:00
|
|
|
- name: mountpoint-dir
|
|
|
|
hostPath:
|
|
|
|
path: /var/lib/kubelet/pods
|
|
|
|
type: DirectoryOrCreate
|
2019-09-26 09:55:12 +00:00
|
|
|
- name: plugin-dir
|
2019-02-21 04:30:21 +00:00
|
|
|
hostPath:
|
2019-09-26 09:55:12 +00:00
|
|
|
path: /var/lib/kubelet/plugins
|
|
|
|
type: Directory
|
2019-02-21 04:30:21 +00:00
|
|
|
- name: host-sys
|
|
|
|
hostPath:
|
|
|
|
path: /sys
|
2020-01-23 08:29:53 +00:00
|
|
|
- name: host-mount
|
|
|
|
hostPath:
|
|
|
|
path: /run/mount
|
2019-02-21 04:30:21 +00:00
|
|
|
- name: lib-modules
|
|
|
|
hostPath:
|
|
|
|
path: /lib/modules
|
2019-09-26 09:55:12 +00:00
|
|
|
- name: host-dev
|
|
|
|
hostPath:
|
|
|
|
path: /dev
|
2019-05-28 19:03:18 +00:00
|
|
|
- name: ceph-csi-config
|
|
|
|
configMap:
|
|
|
|
name: {{ .Values.configMapName | quote }}
|
2019-06-25 19:29:17 +00:00
|
|
|
- name: keys-tmp-dir
|
|
|
|
emptyDir: {
|
|
|
|
medium: "Memory"
|
|
|
|
}
|
2019-07-29 10:36:24 +00:00
|
|
|
{{- if .Values.nodeplugin.affinity }}
|
2019-02-21 04:30:21 +00:00
|
|
|
affinity:
|
2019-12-03 08:18:59 +00:00
|
|
|
{{ toYaml .Values.nodeplugin.affinity | indent 8 -}}
|
2019-07-29 10:36:24 +00:00
|
|
|
{{- end -}}
|
|
|
|
{{- if .Values.nodeplugin.nodeSelector }}
|
2019-02-21 04:30:21 +00:00
|
|
|
nodeSelector:
|
2019-07-29 10:36:24 +00:00
|
|
|
{{ toYaml .Values.nodeplugin.nodeSelector | indent 8 -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- if .Values.nodeplugin.tolerations }}
|
2019-02-21 04:30:21 +00:00
|
|
|
tolerations:
|
2019-07-29 10:36:24 +00:00
|
|
|
{{ toYaml .Values.nodeplugin.tolerations | indent 8 -}}
|
|
|
|
{{- end -}}
|