helm: make kubelet path configurable

removed unwanted extra arguments from the helm templates
and added a single value kubeletDir to make the kubelet
root-dir configurable.

previously used variables like socketDir,registrationDir
and pluginDir is removed now because if we have the kubelet
path we can derive all other required path for cephcsi to
work properly.

fixes: #1475

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna 2020-11-27 19:53:35 +05:30 committed by mergify[bot]
parent 55974973e6
commit 50d884bad3
6 changed files with 20 additions and 40 deletions

View File

@ -43,7 +43,7 @@ spec:
args: args:
- "--v={{ .Values.logLevel }}" - "--v={{ .Values.logLevel }}"
- "--csi-address=/csi/{{ .Values.pluginSocketFile }}" - "--csi-address=/csi/{{ .Values.pluginSocketFile }}"
- "--kubelet-registration-path={{ .Values.socketDir }}/{{ .Values.pluginSocketFile }}" - "--kubelet-registration-path={{ .Values.kubeletDir }}/{{ .Values.driverName }}/{{ .Values.pluginSocketFile }}"
env: env:
- name: KUBE_NODE_NAME - name: KUBE_NODE_NAME
valueFrom: valueFrom:
@ -95,10 +95,10 @@ spec:
- name: socket-dir - name: socket-dir
mountPath: /csi mountPath: /csi
- name: mountpoint-dir - name: mountpoint-dir
mountPath: /var/lib/kubelet/pods mountPath: {{ .Values.kubeletDir }}/pods
mountPropagation: Bidirectional mountPropagation: Bidirectional
- name: plugin-dir - name: plugin-dir
mountPath: /var/lib/kubelet/plugins mountPath: {{ .Values.kubeletDir }}/plugins
mountPropagation: "Bidirectional" mountPropagation: "Bidirectional"
- mountPath: /dev - mountPath: /dev
name: host-dev name: host-dev
@ -144,19 +144,19 @@ spec:
volumes: volumes:
- name: socket-dir - name: socket-dir
hostPath: hostPath:
path: {{ .Values.socketDir }} path: "{{ .Values.kubeletDir }}/{{ .Values.driverName }}"
type: DirectoryOrCreate type: DirectoryOrCreate
- name: registration-dir - name: registration-dir
hostPath: hostPath:
path: {{ .Values.registrationDir }} path: {{ .Values.kubeletDir }}/plugins_registry
type: Directory type: Directory
- name: mountpoint-dir - name: mountpoint-dir
hostPath: hostPath:
path: /var/lib/kubelet/pods path: {{ .Values.kubeletDir }}/pods
type: DirectoryOrCreate type: DirectoryOrCreate
- name: plugin-dir - name: plugin-dir
hostPath: hostPath:
path: /var/lib/kubelet/plugins path: {{ .Values.kubeletDir }}/plugins
type: Directory type: Directory
- name: host-sys - name: host-sys
hostPath: hostPath:

View File

@ -40,12 +40,6 @@ spec:
readOnly: false readOnly: false
- pathPrefix: '/lib/modules' - pathPrefix: '/lib/modules'
readOnly: true readOnly: true
- pathPrefix: '/var/lib/kubelet/pods' - pathPrefix: '{{ .Values.kubeletDir }}'
readOnly: false
- pathPrefix: '{{ .Values.socketDir }}'
readOnly: false
- pathPrefix: '{{ .Values.registrationDir }}'
readOnly: false
- pathPrefix: '{{ .Values.pluginDir }}'
readOnly: false readOnly: false
{{- end }} {{- end }}

View File

@ -195,16 +195,12 @@ topology:
# Variables for 'internal' use please use with caution! # # Variables for 'internal' use please use with caution! #
######################################################### #########################################################
# The directory where the provisioner and pluginSocketFile will be mounted
socketDir: /var/lib/kubelet/plugins/cephfs.csi.ceph.com
# The filename of the provisioner socket # The filename of the provisioner socket
provisionerSocketFile: csi-provisioner.sock provisionerSocketFile: csi-provisioner.sock
# The filename of the plugin socket # The filename of the plugin socket
pluginSocketFile: csi.sock pluginSocketFile: csi.sock
# The directory where nodeplugin socket is created # kubelet working directory,can be set using `--root-dir` when starting kubelet.
registrationDir: /var/lib/kubelet/plugins_registry kubeletDir: /var/lib/kubelet
# The nodeplugin plugins directory
pluginDir: /var/lib/kubelet/plugins
# Name of the csi-driver # Name of the csi-driver
driverName: cephfs.csi.ceph.com driverName: cephfs.csi.ceph.com
# Name of the configmap used for state # Name of the configmap used for state

View File

@ -44,7 +44,7 @@ spec:
args: args:
- "--v={{ .Values.logLevel }}" - "--v={{ .Values.logLevel }}"
- "--csi-address=/csi/{{ .Values.pluginSocketFile }}" - "--csi-address=/csi/{{ .Values.pluginSocketFile }}"
- "--kubelet-registration-path={{ .Values.socketDir }}/{{ .Values.pluginSocketFile }}" - "--kubelet-registration-path={{ .Values.kubeletDir }}/{{ .Values.driverName }}/{{ .Values.pluginSocketFile }}"
env: env:
- name: KUBE_NODE_NAME - name: KUBE_NODE_NAME
valueFrom: valueFrom:
@ -106,10 +106,10 @@ spec:
- name: ceph-csi-encryption-kms-config - name: ceph-csi-encryption-kms-config
mountPath: /etc/ceph-csi-encryption-kms-config/ mountPath: /etc/ceph-csi-encryption-kms-config/
- name: plugin-dir - name: plugin-dir
mountPath: /var/lib/kubelet/plugins mountPath: {{ .Values.kubeletDir }}/plugins
mountPropagation: "Bidirectional" mountPropagation: "Bidirectional"
- name: mountpoint-dir - name: mountpoint-dir
mountPath: /var/lib/kubelet/pods mountPath: {{ .Values.kubeletDir }}/pods
mountPropagation: "Bidirectional" mountPropagation: "Bidirectional"
- name: keys-tmp-dir - name: keys-tmp-dir
mountPath: /tmp/csi/keys mountPath: /tmp/csi/keys
@ -144,19 +144,19 @@ spec:
volumes: volumes:
- name: socket-dir - name: socket-dir
hostPath: hostPath:
path: {{ .Values.socketDir }} path: "{{ .Values.kubeletDir }}/{{ .Values.driverName }}"
type: DirectoryOrCreate type: DirectoryOrCreate
- name: registration-dir - name: registration-dir
hostPath: hostPath:
path: {{ .Values.registrationDir }} path: {{ .Values.kubeletDir }}/plugins_registry
type: Directory type: Directory
- name: plugin-dir - name: plugin-dir
hostPath: hostPath:
path: {{ .Values.pluginDir }} path: {{ .Values.kubeletDir }}/plugins
type: Directory type: Directory
- name: mountpoint-dir - name: mountpoint-dir
hostPath: hostPath:
path: /var/lib/kubelet/pods path: {{ .Values.kubeletDir }}/pods
type: DirectoryOrCreate type: DirectoryOrCreate
- name: host-dev - name: host-dev
hostPath: hostPath:

View File

@ -40,12 +40,6 @@ spec:
readOnly: false readOnly: false
- pathPrefix: '/lib/modules' - pathPrefix: '/lib/modules'
readOnly: true readOnly: true
- pathPrefix: '/var/lib/kubelet/pods' - pathPrefix: '{{ .Values.kubeletDir }}'
readOnly: false
- pathPrefix: '{{ .Values.socketDir }}'
readOnly: false
- pathPrefix: '{{ .Values.registrationDir }}'
readOnly: false
- pathPrefix: '{{ .Values.pluginDir }}'
readOnly: false readOnly: false
{{- end }} {{- end }}

View File

@ -219,16 +219,12 @@ topology:
# Variables for 'internal' use please use with caution! # # Variables for 'internal' use please use with caution! #
######################################################### #########################################################
# The directory where the provisioner and pluginSocketFile will be mounted
socketDir: /var/lib/kubelet/plugins/rbd.csi.ceph.com
# The filename of the provisioner socket # The filename of the provisioner socket
provisionerSocketFile: csi-provisioner.sock provisionerSocketFile: csi-provisioner.sock
# The filename of the plugin socket # The filename of the plugin socket
pluginSocketFile: csi.sock pluginSocketFile: csi.sock
# The directory where nodeplugin socket is created # kubelet working directory,can be set using `--root-dir` when starting kubelet.
registrationDir: /var/lib/kubelet/plugins_registry kubeletDir: /var/lib/kubelet
# The nodeplugin plugins directory
pluginDir: /var/lib/kubelet/plugins
# Name of the csi-driver # Name of the csi-driver
driverName: rbd.csi.ceph.com driverName: rbd.csi.ceph.com
# Name of the configmap used for state # Name of the configmap used for state