You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
quay.io/k8scsi/livenessprobe canary 8f65dd5f789a 16 hours ago 16MB
56
-
```
19
+
## Usage
57
20
58
-
### Using livenessprobe
59
-
60
-
Below is an example of sidecar container which needs to be added to the CSI driver yaml.
21
+
See [hostpath-with-livenessprobe.yaml](deployment/kubernetes/hostpath-with-livenessprobe.yaml)
22
+
for example how to use the liveness probe with a CSI driver. Notice that actual
23
+
`livenessProbe` is set on the container with the CSI driver. This way, Kubernetes
24
+
restarts the CSI driver container when the probe fails. The liveness probe
25
+
sidecar container only provides the HTTP endpoint for the probe and does not
26
+
contain `livenessProbe` section by itself.
61
27
62
28
```yaml
29
+
kind: Pod
30
+
spec:
31
+
containers:
32
+
# Container with CSI driver
63
33
- name: hostpath-driver
64
34
image: quay.io/k8scsi/hostpathplugin:v0.2.0
65
-
imagePullPolicy: Always
66
-
securityContext:
67
-
privileged: true
68
-
#
69
-
# Defining port which will be used to GET plugin health status
70
-
# 9808 is default, but can be changed.
71
-
#
35
+
# Defining port which will be used to GET plugin health status
36
+
# 9808 is default, but can be changed.
72
37
ports:
73
38
- containerPort: 9808
74
39
name: healthz
75
40
protocol: TCP
41
+
# The probe
76
42
livenessProbe:
77
43
failureThreshold: 5
78
44
httpGet:
@@ -81,41 +47,43 @@ Below is an example of sidecar container which needs to be added to the CSI driv
81
47
initialDelaySeconds: 10
82
48
timeoutSeconds: 3
83
49
periodSeconds: 2
84
-
failureThreshold: 1
85
-
volumeMounts:
50
+
volumeMounts:
86
51
- mountPath: /csi
87
52
name: socket-dir
88
-
- mountPath: /var/lib/kubelet/pods
89
-
mountPropagation: Bidirectional
90
-
name: mountpoint-dir
91
-
args:
92
-
- --v=5
93
-
- --endpoint=$(CSI_ENDPOINT)
94
-
- --nodeid=$(KUBE_NODE_NAME)
95
-
env:
96
-
- name: CSI_ENDPOINT
97
-
value: unix:///csi/csi.sock
98
-
- name: KUBE_NODE_NAME
99
-
valueFrom:
100
-
fieldRef:
101
-
apiVersion: v1
102
-
fieldPath: spec.nodeName
103
-
#
104
-
# Spec for liveness probe sidecar container
105
-
#
53
+
# ...
54
+
# The liveness probe sidecar container
106
55
- name: liveness-probe
107
56
imagePullPolicy: Always
108
57
volumeMounts:
109
58
- mountPath: /csi
110
59
name: socket-dir
111
-
image: quay.io/k8scsi/livenessprobe:v0.2.0
60
+
image: quay.io/k8scsi/livenessprobe:v1.1.0
112
61
args:
113
62
- --csi-address=/csi/csi.sock
114
-
- --connection-timeout=3s
115
-
#
116
-
63
+
volumeMounts:
64
+
- mountPath: /csi
65
+
name: socket-dir
66
+
# ...
117
67
```
118
68
69
+
### Command line options
70
+
71
+
#### Recommended optional arguments
72
+
73
+
*`--csi-address <path to CSI socket>`: This is the path to the CSI driver socket inside the pod that the external-provisioner container will use to issue CSI operations (`/run/csi/socket` is used by default).
74
+
75
+
#### Other recognized arguments
76
+
77
+
*`--health-port <number>`: TCP ports for listening for HTTP requests (default "9808")
78
+
79
+
*`--probe-timeout <duration>`: Maximum duration of single `Probe()` call (default "1s").
80
+
81
+
* All glog / klog arguments are supported, such as `-v <log level>` or `-alsologtostderr`.
82
+
83
+
#### Deprecated arguments
84
+
85
+
*`--connection-timeout <duration>`: This option was used to limit establishing connection to CSI driver. Currently, the option does not have any effect and the external-provisioner tries to connect to CSI driver socket indefinitely. It is recommended to run ReadinessProbe on the driver to ensure that the driver comes up in reasonable time.
86
+
119
87
## Community, discussion, contribution, and support
120
88
121
89
Learn how to engage with the Kubernetes community on the [community page](http://kubernetes.io/community/).
0 commit comments