From 1ccbb5b6a53b00794612e1d1067a507e71454f70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=80=80=E5=AE=97?= Date: Fri, 29 Mar 2019 16:12:09 +0800 Subject: [PATCH] cephfs driver deploy support remount volume --- deploy/cephfs/helm/templates/nodeplugin-clusterrole.yaml | 3 +++ deploy/cephfs/helm/templates/nodeplugin-daemonset.yaml | 5 +++++ deploy/cephfs/kubernetes/csi-cephfsplugin.yaml | 5 +++++ deploy/cephfs/kubernetes/csi-nodeplugin-rbac.yaml | 3 +++ 4 files changed, 16 insertions(+) diff --git a/deploy/cephfs/helm/templates/nodeplugin-clusterrole.yaml b/deploy/cephfs/helm/templates/nodeplugin-clusterrole.yaml index 290dd3f33..de4aaeaaa 100644 --- a/deploy/cephfs/helm/templates/nodeplugin-clusterrole.yaml +++ b/deploy/cephfs/helm/templates/nodeplugin-clusterrole.yaml @@ -10,6 +10,9 @@ metadata: release: {{ .Release.Name }} heritage: {{ .Release.Service }} rules: + - apiGroups: [""] + resources: ["configmaps"] + verbs: ["get", "list"] - apiGroups: [""] resources: ["nodes"] verbs: ["get", "list", "update"] diff --git a/deploy/cephfs/helm/templates/nodeplugin-daemonset.yaml b/deploy/cephfs/helm/templates/nodeplugin-daemonset.yaml index 9181d6102..c56e70bb4 100644 --- a/deploy/cephfs/helm/templates/nodeplugin-daemonset.yaml +++ b/deploy/cephfs/helm/templates/nodeplugin-daemonset.yaml @@ -70,6 +70,7 @@ spec: - "--v=5" - "--drivername=$(DRIVER_NAME)" - "--metadatastorage=k8s_configmap" + - "--mountcachedir=/mount-cache-dir" env: - name: HOST_ROOTFS value: "/rootfs" @@ -83,6 +84,8 @@ spec: value: "unix:/{{ .Values.socketDir }}/{{ .Values.socketFile }}" imagePullPolicy: {{ .Values.nodeplugin.plugin.image.imagePullPolicy }} volumeMounts: + - name: mount-cache-dir + mountPath: /mount-cache-dir - name: plugin-dir mountPath: {{ .Values.socketDir }} - name: pods-mount-dir @@ -103,6 +106,8 @@ spec: resources: {{ toYaml .Values.nodeplugin.plugin.resources | indent 12 }} volumes: + - name: mount-cache-dir + emptyDir: {} - name: plugin-dir hostPath: path: {{ .Values.socketDir }} diff --git a/deploy/cephfs/kubernetes/csi-cephfsplugin.yaml b/deploy/cephfs/kubernetes/csi-cephfsplugin.yaml index af4322fee..849cf57b3 100644 --- a/deploy/cephfs/kubernetes/csi-cephfsplugin.yaml +++ b/deploy/cephfs/kubernetes/csi-cephfsplugin.yaml @@ -55,6 +55,7 @@ spec: - "--v=5" - "--drivername=cephfs.csi.ceph.com" - "--metadatastorage=k8s_configmap" + - "--mountcachedir=/mount-cache-dir" env: - name: NODE_ID valueFrom: @@ -68,6 +69,8 @@ spec: value: unix:///csi/csi.sock imagePullPolicy: "IfNotPresent" volumeMounts: + - name: mount-cache-dir + mountPath: /mount-cache-dir - name: plugin-dir mountPath: /csi - name: csi-plugins-dir @@ -84,6 +87,8 @@ spec: - name: host-dev mountPath: /dev volumes: + - name: mount-cache-dir + emptyDir: {} - name: plugin-dir hostPath: path: /var/lib/kubelet/plugins/cephfs.csi.ceph.com/ diff --git a/deploy/cephfs/kubernetes/csi-nodeplugin-rbac.yaml b/deploy/cephfs/kubernetes/csi-nodeplugin-rbac.yaml index cc2919b0e..918bdc983 100644 --- a/deploy/cephfs/kubernetes/csi-nodeplugin-rbac.yaml +++ b/deploy/cephfs/kubernetes/csi-nodeplugin-rbac.yaml @@ -10,6 +10,9 @@ apiVersion: rbac.authorization.k8s.io/v1 metadata: name: cephfs-csi-nodeplugin rules: + - apiGroups: [""] + resources: ["configmaps"] + verbs: ["get", "list"] - apiGroups: [""] resources: ["nodes"] verbs: ["get", "list", "update"]