mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-18 12:20:24 +00:00
f2edc926cf
The lifecycle preStop hook fails on container stop / exit because /bin/sh is not present in the driver registrar container image. the driver-registrar will remove the socket file before stopping. we dont need to have any preStop hook to remove the socket as it was not working as expected Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
197 lines
6.9 KiB
YAML
197 lines
6.9 KiB
YAML
kind: DaemonSet
|
|
apiVersion: apps/v1
|
|
metadata:
|
|
name: {{ include "ceph-csi-cephfs.nodeplugin.fullname" . }}
|
|
namespace: {{ .Release.Namespace }}
|
|
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 }}
|
|
updateStrategy:
|
|
type: {{ .Values.nodeplugin.updateStrategy }}
|
|
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
|
|
# 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
|
|
image: "{{ .Values.nodeplugin.registrar.image.repository }}:{{ .Values.nodeplugin.registrar.image.tag }}"
|
|
imagePullPolicy: {{ .Values.nodeplugin.registrar.image.pullPolicy }}
|
|
args:
|
|
- "--v=5"
|
|
- "--csi-address=/csi/{{ .Values.pluginSocketFile }}"
|
|
- "--kubelet-registration-path={{ .Values.socketDir }}/{{ .Values.pluginSocketFile }}"
|
|
env:
|
|
- name: KUBE_NODE_NAME
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: spec.nodeName
|
|
volumeMounts:
|
|
- name: socket-dir
|
|
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 }}"
|
|
imagePullPolicy: {{ .Values.nodeplugin.plugin.image.pullPolicy }}
|
|
args:
|
|
- "--nodeid=$(NODE_ID)"
|
|
- "--type=cephfs"
|
|
- "--nodeserver=true"
|
|
- "--pidlimit=-1"
|
|
{{- if .Values.nodeplugin.forcecephkernelclient }}
|
|
- "--forcecephkernelclient={{ .Values.nodeplugin.forcecephkernelclient }}"
|
|
{{- end }}
|
|
- "--endpoint=$(CSI_ENDPOINT)"
|
|
- "--v=5"
|
|
- "--drivername=$(DRIVER_NAME)"
|
|
{{- if .Values.topology.enabled }}
|
|
- "--domainlabels={{ .Values.topology.domainLabels | join "," }}"
|
|
{{- end }}
|
|
env:
|
|
- name: POD_IP
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: status.podIP
|
|
- name: DRIVER_NAME
|
|
value: {{ .Values.driverName }}
|
|
- name: NODE_ID
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: spec.nodeName
|
|
- name: CSI_ENDPOINT
|
|
value: "unix:///csi/{{ .Values.pluginSocketFile }}"
|
|
securityContext:
|
|
privileged: true
|
|
capabilities:
|
|
add: ["SYS_ADMIN"]
|
|
allowPrivilegeEscalation: true
|
|
volumeMounts:
|
|
- name: socket-dir
|
|
mountPath: /csi
|
|
- name: mountpoint-dir
|
|
mountPath: /var/lib/kubelet/pods
|
|
mountPropagation: Bidirectional
|
|
- name: plugin-dir
|
|
mountPath: /var/lib/kubelet/plugins
|
|
mountPropagation: "Bidirectional"
|
|
- mountPath: /dev
|
|
name: host-dev
|
|
- mountPath: /run/mount
|
|
name: host-mount
|
|
- mountPath: /sys
|
|
name: host-sys
|
|
- mountPath: /lib/modules
|
|
name: lib-modules
|
|
readOnly: true
|
|
- name: ceph-csi-config
|
|
mountPath: /etc/ceph-csi-config/
|
|
- name: keys-tmp-dir
|
|
mountPath: /tmp/csi/keys
|
|
resources:
|
|
{{ toYaml .Values.nodeplugin.plugin.resources | indent 12 }}
|
|
{{- if .Values.nodeplugin.httpMetrics.enabled }}
|
|
- name: liveness-prometheus
|
|
securityContext:
|
|
privileged: true
|
|
image: "{{ .Values.nodeplugin.plugin.image.repository }}:{{ .Values.nodeplugin.plugin.image.tag }}"
|
|
imagePullPolicy: {{ .Values.nodeplugin.plugin.image.pullPolicy }}
|
|
args:
|
|
- "--type=liveness"
|
|
- "--endpoint=$(CSI_ENDPOINT)"
|
|
- "--metricsport={{ .Values.nodeplugin.httpMetrics.containerPort }}"
|
|
- "--metricspath=/metrics"
|
|
- "--polltime=60s"
|
|
- "--timeout=3s"
|
|
env:
|
|
- name: CSI_ENDPOINT
|
|
value: "unix:///csi/{{ .Values.pluginSocketFile }}"
|
|
- name: POD_IP
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: status.podIP
|
|
volumeMounts:
|
|
- name: socket-dir
|
|
mountPath: /csi
|
|
resources:
|
|
{{ toYaml .Values.nodeplugin.plugin.resources | indent 12 }}
|
|
{{- end }}
|
|
volumes:
|
|
- name: socket-dir
|
|
hostPath:
|
|
path: {{ .Values.socketDir }}
|
|
type: DirectoryOrCreate
|
|
- name: registration-dir
|
|
hostPath:
|
|
path: {{ .Values.registrationDir }}
|
|
type: Directory
|
|
- name: mountpoint-dir
|
|
hostPath:
|
|
path: /var/lib/kubelet/pods
|
|
type: DirectoryOrCreate
|
|
- name: plugin-dir
|
|
hostPath:
|
|
path: /var/lib/kubelet/plugins
|
|
type: Directory
|
|
- name: host-sys
|
|
hostPath:
|
|
path: /sys
|
|
- name: host-mount
|
|
hostPath:
|
|
path: /run/mount
|
|
- name: lib-modules
|
|
hostPath:
|
|
path: /lib/modules
|
|
- name: host-dev
|
|
hostPath:
|
|
path: /dev
|
|
- name: ceph-csi-config
|
|
configMap:
|
|
name: {{ .Values.configMapName | quote }}
|
|
{{- if .Values.configMapKey }}
|
|
items:
|
|
- key: {{ .Values.configMapKey | quote }}
|
|
path: config.json
|
|
{{- end }}
|
|
- name: keys-tmp-dir
|
|
emptyDir: {
|
|
medium: "Memory"
|
|
}
|
|
{{- 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 -}}
|