2019-09-26 09:55:12 +00:00
|
|
|
{{- if semverCompare ">=1.14" .Capabilities.KubeVersion.GitVersion -}}
|
2019-07-25 06:49:44 +00:00
|
|
|
kind: Deployment
|
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.provisioner.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.provisioner.name }}
|
|
|
|
release: {{ .Release.Name }}
|
|
|
|
heritage: {{ .Release.Service }}
|
|
|
|
spec:
|
2019-07-29 10:36:24 +00:00
|
|
|
replicas: {{ .Values.provisioner.replicaCount }}
|
2019-02-21 04:30:21 +00:00
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
app: {{ include "ceph-csi-cephfs.name" . }}
|
|
|
|
component: {{ .Values.provisioner.name }}
|
|
|
|
release: {{ .Release.Name }}
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
app: {{ include "ceph-csi-cephfs.name" . }}
|
|
|
|
chart: {{ include "ceph-csi-cephfs.chart" . }}
|
|
|
|
component: {{ .Values.provisioner.name }}
|
|
|
|
release: {{ .Release.Name }}
|
|
|
|
heritage: {{ .Release.Service }}
|
|
|
|
spec:
|
|
|
|
serviceAccountName: {{ include "ceph-csi-cephfs.serviceAccountName.provisioner" . }}
|
|
|
|
containers:
|
|
|
|
- name: csi-provisioner
|
2019-07-29 10:36:24 +00:00
|
|
|
image: "{{ .Values.provisioner.provisioner.image.repository }}:{{ .Values.provisioner.provisioner.image.tag }}"
|
2019-09-26 09:55:12 +00:00
|
|
|
imagePullPolicy: {{ .Values.provisioner.provisioner.image.pullPolicy }}
|
2019-02-21 04:30:21 +00:00
|
|
|
args:
|
|
|
|
- "--csi-address=$(ADDRESS)"
|
|
|
|
- "--v=5"
|
2019-09-26 09:55:12 +00:00
|
|
|
- "--timeout={{ .Values.provisioner.timeout }}"
|
2019-07-25 06:49:44 +00:00
|
|
|
- "--enable-leader-election=true"
|
|
|
|
- "--leader-election-type=leases"
|
Move locks to more granular locking than CPU count based
As detailed in issue #279, current lock scheme has hash
buckets that are count of CPUs. This causes a lot of contention
when parallel requests are made to the CSI plugin. To reduce
lock contention, this commit introduces granular locks per
identifier.
The commit also changes the timeout for gRPC requests to Create
and Delete volumes, as the current timeout is 10s (kubernetes
documentation says 15s but code defaults are 10s). A virtual
setup takes about 12-15s to complete a request at times, that leads
to unwanted retries of the same request, hence the increased
timeout to enable operation completion with minimal retries.
Tests to create PVCs before and after these changes look like so,
Before:
Default master code + sidecar provisioner --timeout option set
to 30 seconds
20 PVCs
Creation: 3 runs, 396/391/400 seconds
Deletion: 3 runs, 218/271/118 seconds
- Once was stalled for more than 8 minutes and cancelled the run
After:
Current commit + sidecar provisioner --timeout option set to 30 sec
20 PVCs
Creation: 3 runs, 42/59/65 seconds
Deletion: 3 runs, 32/32/31 seconds
Fixes: #279
Signed-off-by: ShyamsundarR <srangana@redhat.com>
2019-06-22 16:43:28 +00:00
|
|
|
- "--retry-interval-start=500ms"
|
2019-02-21 04:30:21 +00:00
|
|
|
env:
|
|
|
|
- name: ADDRESS
|
2019-09-26 09:55:12 +00:00
|
|
|
value: "unix:///csi/{{ .Values.provisionerSocketFile }}"
|
2019-02-21 04:30:21 +00:00
|
|
|
volumeMounts:
|
|
|
|
- name: socket-dir
|
2019-09-26 09:55:12 +00:00
|
|
|
mountPath: /csi
|
2019-02-21 04:30:21 +00:00
|
|
|
resources:
|
2019-09-26 09:55:12 +00:00
|
|
|
{{ toYaml .Values.provisioner.provisioner.resources | indent 12 }}
|
2019-07-29 10:36:24 +00:00
|
|
|
{{- if .Values.provisioner.attacher.enabled }}
|
2019-03-27 08:46:48 +00:00
|
|
|
- name: csi-attacher
|
2019-07-29 10:36:24 +00:00
|
|
|
image: "{{ .Values.provisioner.attacher.image.repository }}:{{ .Values.provisioner.attacher.image.tag }}"
|
|
|
|
imagePullPolicy: {{ .Values.provisioner.attacher.image.pullPolicy }}
|
2019-03-27 08:46:48 +00:00
|
|
|
args:
|
|
|
|
- "--v=5"
|
|
|
|
- "--csi-address=$(ADDRESS)"
|
2019-09-26 09:55:12 +00:00
|
|
|
- "--leader-election=true"
|
2019-03-27 08:46:48 +00:00
|
|
|
env:
|
|
|
|
- name: ADDRESS
|
2019-09-26 09:55:12 +00:00
|
|
|
value: "unix:///csi/{{ .Values.provisionerSocketFile }}"
|
2019-03-27 08:46:48 +00:00
|
|
|
volumeMounts:
|
|
|
|
- name: socket-dir
|
2019-09-26 09:55:12 +00:00
|
|
|
mountPath: /csi
|
2019-07-29 10:36:24 +00:00
|
|
|
resources:
|
|
|
|
{{ toYaml .Values.nodeplugin.plugin.resources | indent 12 }}
|
2019-11-25 11:09:24 +00:00
|
|
|
{{- end }}
|
|
|
|
{{- if semverCompare ">=1.15" .Capabilities.KubeVersion.GitVersion -}}
|
|
|
|
{{- if .Values.provisioner.resizer.enabled }}
|
|
|
|
- name: csi-resizer
|
|
|
|
image: "{{ .Values.provisioner.resizer.image.repository }}:{{ .Values.provisioner.resizer.image.tag }}"
|
|
|
|
imagePullPolicy: {{ .Values.provisioner.resizer.image.pullPolicy }}
|
|
|
|
args:
|
|
|
|
- "--v=5"
|
|
|
|
- "--csi-address=$(ADDRESS)"
|
2019-11-26 08:29:28 +00:00
|
|
|
- "--csiTimeout={{ .Values.provisioner.timeout }}"
|
2019-11-25 11:09:24 +00:00
|
|
|
- "--leader-election"
|
|
|
|
env:
|
|
|
|
- name: ADDRESS
|
|
|
|
value: "unix:///csi/{{ .Values.provisionerSocketFile }}"
|
|
|
|
volumeMounts:
|
|
|
|
- name: socket-dir
|
|
|
|
mountPath: /csi
|
|
|
|
resources:
|
|
|
|
{{ toYaml .Values.provisioner.resizer.resources | indent 12 }}
|
|
|
|
{{- end }}
|
2019-07-29 10:36:24 +00:00
|
|
|
{{- end }}
|
2019-02-21 04:30:21 +00:00
|
|
|
- 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
|
|
|
- "--controllerserver=true"
|
2019-09-26 09:55:12 +00:00
|
|
|
- "--pidlimit=-1"
|
|
|
|
{{- if .Values.provisioner.grpcMetrics.enabled }}
|
|
|
|
- "--metricsport={{ .Values.nodeplugin.grpcMetrics.containerPort }}"
|
|
|
|
- "--metricspath=/metrics"
|
|
|
|
- "--enablegrpcmetrics=true"
|
|
|
|
{{- 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"
|
|
|
|
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.provisionerSocketFile }}"
|
|
|
|
securityContext:
|
|
|
|
privileged: true
|
|
|
|
capabilities:
|
|
|
|
add: ["SYS_ADMIN"]
|
|
|
|
allowPrivilegeEscalation: true
|
2019-02-21 04:30:21 +00:00
|
|
|
volumeMounts:
|
|
|
|
- name: socket-dir
|
2019-09-26 09:55:12 +00:00
|
|
|
mountPath: /csi
|
|
|
|
- name: host-sys
|
|
|
|
mountPath: /sys
|
|
|
|
- name: lib-modules
|
|
|
|
mountPath: /lib/modules
|
|
|
|
readOnly: true
|
|
|
|
- name: host-dev
|
|
|
|
mountPath: /dev
|
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-08-15 08:00:25 +00:00
|
|
|
{{ toYaml .Values.nodeplugin.plugin.resources | indent 12 }}
|
2019-09-26 09:55:12 +00:00
|
|
|
{{- if .Values.provisioner.httpMetrics.enabled }}
|
2019-08-15 08:00:25 +00:00
|
|
|
- name: liveness-prometheus
|
|
|
|
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-08-15 08:00:25 +00:00
|
|
|
args:
|
|
|
|
- "--type=liveness"
|
|
|
|
- "--endpoint=$(CSI_ENDPOINT)"
|
2019-09-26 09:55:12 +00:00
|
|
|
- "--metricsport={{ .Values.provisioner.httpMetrics.containerPort }}"
|
2019-08-21 09:28:02 +00:00
|
|
|
- "--metricspath=/metrics"
|
2019-08-15 08:00:25 +00:00
|
|
|
- "--polltime=60s"
|
|
|
|
- "--timeout=3s"
|
|
|
|
env:
|
|
|
|
- name: CSI_ENDPOINT
|
2019-09-26 09:55:12 +00:00
|
|
|
value: "unix:///csi/{{ .Values.provisionerSocketFile }}"
|
2019-08-15 08:00:25 +00:00
|
|
|
- name: POD_IP
|
|
|
|
valueFrom:
|
|
|
|
fieldRef:
|
|
|
|
fieldPath: status.podIP
|
|
|
|
volumeMounts:
|
|
|
|
- name: socket-dir
|
2019-09-26 09:55:12 +00:00
|
|
|
mountPath: /csi
|
2019-08-15 08:00:25 +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:
|
|
|
|
- name: socket-dir
|
2020-01-13 04:05:50 +00:00
|
|
|
emptyDir: {
|
|
|
|
medium: "Memory"
|
|
|
|
}
|
2019-09-26 09:55:12 +00:00
|
|
|
- name: host-sys
|
|
|
|
hostPath:
|
|
|
|
path: /sys
|
|
|
|
- name: lib-modules
|
|
|
|
hostPath:
|
|
|
|
path: /lib/modules
|
|
|
|
- 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.provisioner.affinity }}
|
2019-02-21 04:30:21 +00:00
|
|
|
affinity:
|
2019-12-03 08:18:59 +00:00
|
|
|
{{ toYaml .Values.provisioner.affinity | indent 8 -}}
|
2019-07-29 10:36:24 +00:00
|
|
|
{{- end -}}
|
|
|
|
{{- if .Values.provisioner.nodeSelector }}
|
2019-02-21 04:30:21 +00:00
|
|
|
nodeSelector:
|
2019-07-29 10:36:24 +00:00
|
|
|
{{ toYaml .Values.provisioner.nodeSelector | indent 8 -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- if .Values.provisioner.tolerations }}
|
2019-02-21 04:30:21 +00:00
|
|
|
tolerations:
|
2019-07-29 10:36:24 +00:00
|
|
|
{{ toYaml .Values.provisioner.tolerations | indent 8 -}}
|
|
|
|
{{- end -}}
|
2019-09-26 09:55:12 +00:00
|
|
|
{{- end -}}
|