From f2edc926cf3c471feb27600b6f62c73957b5c308 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Mon, 24 Aug 2020 13:27:29 +0530 Subject: [PATCH] deploy: remove preStop hook from daemonset templates 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 --- .../templates/nodeplugin-daemonset.yaml | 12 ------------ .../ceph-csi-rbd/templates/nodeplugin-daemonset.yaml | 12 ------------ deploy/cephfs/kubernetes/csi-cephfsplugin.yaml | 8 -------- deploy/rbd/kubernetes/csi-rbdplugin.yaml | 8 -------- 4 files changed, 40 deletions(-) diff --git a/charts/ceph-csi-cephfs/templates/nodeplugin-daemonset.yaml b/charts/ceph-csi-cephfs/templates/nodeplugin-daemonset.yaml index fcc6581b7..18884ca6c 100644 --- a/charts/ceph-csi-cephfs/templates/nodeplugin-daemonset.yaml +++ b/charts/ceph-csi-cephfs/templates/nodeplugin-daemonset.yaml @@ -44,18 +44,6 @@ spec: - "--v=5" - "--csi-address=/csi/{{ .Values.pluginSocketFile }}" - "--kubelet-registration-path={{ .Values.socketDir }}/{{ .Values.pluginSocketFile }}" - lifecycle: - preStop: - exec: - {{- /* - NOTE(wilmardo): The replace functions ensures there are no spaces in the string. - To avoid `rm -rf /registration/driver name` - */}} - command: [ - "/bin/sh", "-c", - "rm -rf /registration/{{ .Values.driverName | replace " " "" }} \ - /registration/{{ .Values.driverName | replace " " "" }}-reg.sock" - ] env: - name: KUBE_NODE_NAME valueFrom: diff --git a/charts/ceph-csi-rbd/templates/nodeplugin-daemonset.yaml b/charts/ceph-csi-rbd/templates/nodeplugin-daemonset.yaml index eb31759d3..484b53eb1 100644 --- a/charts/ceph-csi-rbd/templates/nodeplugin-daemonset.yaml +++ b/charts/ceph-csi-rbd/templates/nodeplugin-daemonset.yaml @@ -45,18 +45,6 @@ spec: - "--v=5" - "--csi-address=/csi/{{ .Values.pluginSocketFile }}" - "--kubelet-registration-path={{ .Values.socketDir }}/{{ .Values.pluginSocketFile }}" - lifecycle: - preStop: - exec: - {{- /* - NOTE(wilmardo): The replace functions ensures there are no spaces in the string. - To avoid `rm -rf /registration/driver name` - */}} - command: [ - "/bin/sh", "-c", - "rm -rf /registration/{{ .Values.driverName | replace " " "" }} \ - /registration/{{ .Values.driverName | replace " " "" }}-reg.sock" - ] env: - name: KUBE_NODE_NAME valueFrom: diff --git a/deploy/cephfs/kubernetes/csi-cephfsplugin.yaml b/deploy/cephfs/kubernetes/csi-cephfsplugin.yaml index d62ca9d8b..8d54c3097 100644 --- a/deploy/cephfs/kubernetes/csi-cephfsplugin.yaml +++ b/deploy/cephfs/kubernetes/csi-cephfsplugin.yaml @@ -29,14 +29,6 @@ spec: - "--v=5" - "--csi-address=/csi/csi.sock" - "--kubelet-registration-path=/var/lib/kubelet/plugins/cephfs.csi.ceph.com/csi.sock" - lifecycle: - preStop: - exec: - command: [ - "/bin/sh", "-c", - "rm -rf /registration/cephfs.csi.ceph.com \ - /registration/cephfs.csi.ceph.com-reg.sock" - ] env: - name: KUBE_NODE_NAME valueFrom: diff --git a/deploy/rbd/kubernetes/csi-rbdplugin.yaml b/deploy/rbd/kubernetes/csi-rbdplugin.yaml index de6736155..25f2d020c 100644 --- a/deploy/rbd/kubernetes/csi-rbdplugin.yaml +++ b/deploy/rbd/kubernetes/csi-rbdplugin.yaml @@ -30,14 +30,6 @@ spec: - "--v=5" - "--csi-address=/csi/csi.sock" - "--kubelet-registration-path=/var/lib/kubelet/plugins/rbd.csi.ceph.com/csi.sock" - lifecycle: - preStop: - exec: - command: [ - "/bin/sh", "-c", - "rm -rf /registration/rbd.csi.ceph.com \ - /registration/rbd.csi.ceph.com-reg.sock" - ] env: - name: KUBE_NODE_NAME valueFrom: