From dcf1c46f8fc3e5c0f4a41c0db9a467e6358c8592 Mon Sep 17 00:00:00 2001 From: andyzhangx Date: Sat, 9 Oct 2021 03:29:46 +0000 Subject: [PATCH] feat: add registrar liveness probe --- charts/latest/csi-driver-nfs-v3.0.0.tgz | Bin 3455 -> 3498 bytes .../templates/csi-nfs-node.yaml | 8 ++++++++ deploy/csi-nfs-node.yaml | 8 ++++++++ pkg/nfs/nodeserver.go | 3 +-- 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/charts/latest/csi-driver-nfs-v3.0.0.tgz b/charts/latest/csi-driver-nfs-v3.0.0.tgz index 72d13ab476666f2b2259edd15b0c3bae7cd8c4ca..9c9cc384c15c207ec62edef78764241e52706a69 100644 GIT binary patch delta 3212 zcmV;740H4U8mb$RJ%3Z+aol{#|rzpkl zBs$2Fk0b}OEcb7}CCN@~$06Zk;7pz90fN-gLS&W9Toy#yUPmNPp`6eNKSq(rxHh6h5{bqTw9F8;;O}GP_Vatl zX@NLm1=o}@7+^jmwp+whWC8S1gBCC(Od-&rc?j2p+kc0dLi4u-am@oWpWs>w#!$NL z#M;^HnXd?J!3jwa#1Q(q1i83|U1@qD4fELZ!=AsYB@f@7}H%%f#q2PLPGL>j7xNP!hAz=8ovY z6;4BF*?*TS1;gNKw%HmZNbIbw{FRE-j21G4*3k`BS`{5Q9AczHXq||DG{!h%*jkH! zzUq__j*pwgGprZYX`Xrj3Ay==lL?`W3>b#cT~NsydfaZ-T!Wn65Q)yD<%8Tz`KkYl z6j@rhfqQ$NbEB|q9YLgMVBC)i&)eF9a~z^X9+L|LGJob34CyG7=%*sKW=JSU**5%q z%gj$Doe+(M+fUox)|O|x&N9aOPM{F}_=mRze!iquKGbk=BDXe)*?(fI<$oHJ)b8Ky zlhcc%exPsk)8|-q{@d>D)bhXG-ClQ-|Gh+mi!s(ubyUF!wKm}@#*~RE#wMQG4LV|( z*>eKVyA==+jWN2ak4{CbKxv{g^&V1&M4{P}(E}PmPvP#)$l#dyzCwnP7I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c{1{l*tlMFG_fS#axDh5$44iaS;0Muu7umyUfDKfol?vHf-$m$j<}Hc ze0{9C|FPTKTloE-?ale`ip>r4DwP+EsBYW8PJAyI{3+Y^Z}DP0YMVa~ s#YZ*a?Kz_XiLSELo_;HnUkx@Dlug-`@1XpD00030|H(B5Z~#;Q0N->pRsaA1 diff --git a/charts/latest/csi-driver-nfs/templates/csi-nfs-node.yaml b/charts/latest/csi-driver-nfs/templates/csi-nfs-node.yaml index 180b681bd..8bd71866c 100644 --- a/charts/latest/csi-driver-nfs/templates/csi-nfs-node.yaml +++ b/charts/latest/csi-driver-nfs/templates/csi-nfs-node.yaml @@ -56,6 +56,14 @@ spec: preStop: exec: command: ["/bin/sh", "-c", "rm -rf /registration/csi-nfsplugin /registration/csi-nfsplugin-reg.sock"] + livenessProbe: + exec: + command: + - /csi-node-driver-registrar + - --kubelet-registration-path=$(DRIVER_REG_SOCK_PATH) + - --mode=kubelet-registration-probe + initialDelaySeconds: 30 + timeoutSeconds: 15 args: - --v=2 - --csi-address=/csi/csi.sock diff --git a/deploy/csi-nfs-node.yaml b/deploy/csi-nfs-node.yaml index 8de598579..3b4f66ba0 100644 --- a/deploy/csi-nfs-node.yaml +++ b/deploy/csi-nfs-node.yaml @@ -53,6 +53,14 @@ spec: - --v=2 - --csi-address=/csi/csi.sock - --kubelet-registration-path=$(DRIVER_REG_SOCK_PATH) + livenessProbe: + exec: + command: + - /csi-node-driver-registrar + - --kubelet-registration-path=$(DRIVER_REG_SOCK_PATH) + - --mode=kubelet-registration-probe + initialDelaySeconds: 30 + timeoutSeconds: 15 env: - name: DRIVER_REG_SOCK_PATH value: /var/lib/kubelet/plugins/csi-nfsplugin/csi.sock diff --git a/pkg/nfs/nodeserver.go b/pkg/nfs/nodeserver.go index f2e685876..4324a204a 100644 --- a/pkg/nfs/nodeserver.go +++ b/pkg/nfs/nodeserver.go @@ -149,8 +149,7 @@ func (ns *NodeServer) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGetVo return nil, status.Error(codes.InvalidArgument, "NodeGetVolumeStats volume path was empty") } - _, err := os.Stat(req.VolumePath) - if err != nil { + if _, err := os.Lstat(req.VolumePath); err != nil { if os.IsNotExist(err) { return nil, status.Errorf(codes.NotFound, "path %s does not exist", req.VolumePath) }