mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-25 14:30:22 +00:00
197 lines
7.0 KiB
YAML
197 lines
7.0 KiB
YAML
{{- if semverCompare ">=1.14" .Capabilities.KubeVersion.GitVersion -}}
|
|
kind: Deployment
|
|
apiVersion: apps/v1
|
|
metadata:
|
|
name: {{ include "ceph-csi-rbd.provisioner.fullname" . }}
|
|
namespace: {{ .Release.Namespace }}
|
|
labels:
|
|
app: {{ include "ceph-csi-rbd.name" . }}
|
|
chart: {{ include "ceph-csi-rbd.chart" . }}
|
|
component: {{ .Values.provisioner.name }}
|
|
release: {{ .Release.Name }}
|
|
heritage: {{ .Release.Service }}
|
|
spec:
|
|
replicas: {{ .Values.provisioner.replicaCount }}
|
|
selector:
|
|
matchLabels:
|
|
app: {{ include "ceph-csi-rbd.name" . }}
|
|
component: {{ .Values.provisioner.name }}
|
|
release: {{ .Release.Name }}
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: {{ include "ceph-csi-rbd.name" . }}
|
|
chart: {{ include "ceph-csi-rbd.chart" . }}
|
|
component: {{ .Values.provisioner.name }}
|
|
release: {{ .Release.Name }}
|
|
heritage: {{ .Release.Service }}
|
|
spec:
|
|
serviceAccountName: {{ include "ceph-csi-rbd.serviceAccountName.provisioner" . }}
|
|
containers:
|
|
- name: csi-provisioner
|
|
image: "{{ .Values.provisioner.provisioner.image.repository }}:{{ .Values.provisioner.provisioner.image.tag }}"
|
|
imagePullPolicy: {{ .Values.provisioner.provisioner.image.pullPolicy }}
|
|
args:
|
|
- "--csi-address=$(ADDRESS)"
|
|
- "--v=5"
|
|
- "--timeout={{ .Values.provisioner.timeout }}"
|
|
- "--enable-leader-election=true"
|
|
- "--leader-election-type=leases"
|
|
- "--retry-interval-start=500ms"
|
|
env:
|
|
- name: ADDRESS
|
|
value: "unix:///csi/{{ .Values.provisionerSocketFile }}"
|
|
volumeMounts:
|
|
- name: socket-dir
|
|
mountPath: /csi
|
|
resources:
|
|
{{ toYaml .Values.provisioner.provisioner.resources | indent 12 }}
|
|
- name: csi-snapshotter
|
|
image: {{ .Values.provisioner.snapshotter.image.repository }}:{{ .Values.provisioner.snapshotter.image.tag }}
|
|
imagePullPolicy: {{ .Values.provisioner.snapshotter.image.pullPolicy }}
|
|
args:
|
|
- "--csi-address=$(ADDRESS)"
|
|
- "--v=5"
|
|
- "--timeout={{ .Values.provisioner.timeout }}"
|
|
- "leader-election=true"
|
|
env:
|
|
- name: ADDRESS
|
|
value: "unix:///csi/{{ .Values.provisionerSocketFile }}"
|
|
securityContext:
|
|
privileged: true
|
|
volumeMounts:
|
|
- name: socket-dir
|
|
mountPath: /csi
|
|
resources:
|
|
{{ toYaml .Values.provisioner.snapshotter.resources | indent 12 }}
|
|
{{- if .Values.provisioner.attacher.enabled }}
|
|
- name: csi-attacher
|
|
image: "{{ .Values.provisioner.attacher.image.repository }}:{{ .Values.provisioner.attacher.image.tag }}"
|
|
imagePullPolicy: {{ .Values.provisioner.attacher.image.pullPolicy }}
|
|
args:
|
|
- "--v=5"
|
|
- "--csi-address=$(ADDRESS)"
|
|
- "--leader-election=true"
|
|
- "--leader-election-type=leases"
|
|
env:
|
|
- name: ADDRESS
|
|
value: "unix:///csi/{{ .Values.provisionerSocketFile }}"
|
|
volumeMounts:
|
|
- name: socket-dir
|
|
mountPath: /csi
|
|
resources:
|
|
{{ toYaml .Values.provisioner.attacher.resources | indent 12 }}
|
|
{{- end }}
|
|
- name: csi-rbdplugin
|
|
image: "{{ .Values.nodeplugin.plugin.image.repository }}:{{ .Values.nodeplugin.plugin.image.tag }}"
|
|
imagePullPolicy: {{ .Values.nodeplugin.plugin.image.pullPolicy }}
|
|
args:
|
|
- "--nodeid=$(NODE_ID)"
|
|
- "--type=rbd"
|
|
- "--controllerserver=true"
|
|
- "--pidlimit=-1"
|
|
{{- if .Values.provisioner.grpcMetrics.enabled }}
|
|
- "--metricsport={{ .Values.nodeplugin.grpcMetrics.containerPort }}"
|
|
- "--metricspath=/metrics"
|
|
- "--enablegrpcmetrics=true"
|
|
{{- end }}
|
|
- "--endpoint=$(CSI_ENDPOINT)"
|
|
- "--v=5"
|
|
- "--drivername=$(DRIVER_NAME)"
|
|
env:
|
|
- name: POD_IP
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: status.podIP
|
|
- name: DRIVER_NAME
|
|
value: {{ .Values.driverName }}
|
|
- name: NODE_ID
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: spec.nodeName
|
|
- name: POD_NAMESPACE
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: metadata.namespace
|
|
- name: CSI_ENDPOINT
|
|
value: "unix:///csi/{{ .Values.provisionerSocketFile }}"
|
|
securityContext:
|
|
privileged: true
|
|
capabilities:
|
|
add: ["SYS_ADMIN"]
|
|
allowPrivilegeEscalation: true
|
|
volumeMounts:
|
|
- name: socket-dir
|
|
mountPath: /csi
|
|
- mountPath: /dev
|
|
name: host-dev
|
|
- 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.provisioner.httpMetrics.enabled }}
|
|
- name: liveness-prometheus
|
|
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.provisioner.httpMetrics.containerPort }}"
|
|
- "--metricspath=/metrics"
|
|
- "--polltime=60s"
|
|
- "--timeout=3s"
|
|
env:
|
|
- name: CSI_ENDPOINT
|
|
value: "unix:///csi/{{ .Values.provisionerSocketFile }}"
|
|
- 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: host-dev
|
|
hostPath:
|
|
path: /dev
|
|
- name: host-sys
|
|
hostPath:
|
|
path: /sys
|
|
- name: lib-modules
|
|
hostPath:
|
|
path: /lib/modules
|
|
- name: ceph-csi-config
|
|
configMap:
|
|
name: {{ .Values.configMapName | quote }}
|
|
- name: keys-tmp-dir
|
|
emptyDir: {
|
|
medium: "Memory"
|
|
}
|
|
{{- if .Values.provisioner.affinity }}
|
|
affinity:
|
|
{{ toYaml .Values.provisioner.affinity | indent 8 -}}
|
|
{{- end -}}
|
|
{{- if .Values.provisioner.nodeSelector }}
|
|
nodeSelector:
|
|
{{ toYaml .Values.provisioner.nodeSelector | indent 8 -}}
|
|
{{- end -}}
|
|
{{- if .Values.provisioner.tolerations }}
|
|
tolerations:
|
|
{{ toYaml .Values.provisioner.tolerations | indent 8 -}}
|
|
{{- end -}}
|
|
{{- end -}}
|