Merge pull request #234 from andyzhangx/liveness-linux
feat: add registrar liveness probe
This commit is contained in:
commit
85cd36ede4
Binary file not shown.
@ -56,6 +56,14 @@ spec:
|
|||||||
preStop:
|
preStop:
|
||||||
exec:
|
exec:
|
||||||
command: ["/bin/sh", "-c", "rm -rf /registration/csi-nfsplugin /registration/csi-nfsplugin-reg.sock"]
|
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:
|
args:
|
||||||
- --v=2
|
- --v=2
|
||||||
- --csi-address=/csi/csi.sock
|
- --csi-address=/csi/csi.sock
|
||||||
|
|||||||
@ -53,6 +53,14 @@ spec:
|
|||||||
- --v=2
|
- --v=2
|
||||||
- --csi-address=/csi/csi.sock
|
- --csi-address=/csi/csi.sock
|
||||||
- --kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)
|
- --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:
|
env:
|
||||||
- name: DRIVER_REG_SOCK_PATH
|
- name: DRIVER_REG_SOCK_PATH
|
||||||
value: /var/lib/kubelet/plugins/csi-nfsplugin/csi.sock
|
value: /var/lib/kubelet/plugins/csi-nfsplugin/csi.sock
|
||||||
|
|||||||
@ -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")
|
return nil, status.Error(codes.InvalidArgument, "NodeGetVolumeStats volume path was empty")
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err := os.Stat(req.VolumePath)
|
if _, err := os.Lstat(req.VolumePath); err != nil {
|
||||||
if err != nil {
|
|
||||||
if os.IsNotExist(err) {
|
if os.IsNotExist(err) {
|
||||||
return nil, status.Errorf(codes.NotFound, "path %s does not exist", req.VolumePath)
|
return nil, status.Errorf(codes.NotFound, "path %s does not exist", req.VolumePath)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user