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
Copy file name to clipboardExpand all lines: articles/service-fabric/probes-codepackage.md
+23-21Lines changed: 23 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,45 +3,47 @@ title: Azure Service Fabric probes
3
3
description: How to model a liveness probe in Azure Service Fabric by using application and service manifest files.
4
4
5
5
ms.topic: conceptual
6
+
author: tugup
7
+
ms.author: tugup
6
8
ms.date: 3/12/2020
7
9
---
8
10
# Liveness probe
9
-
Starting with version 7.1, Service Fabric supports a liveness probe mechanism for [containerized][containers-introduction-link] applications. A liveness probe helps to report the liveness of a containerized application, which will restart if it does not respond in a timely fashion.
11
+
Starting with version 7.1, Azure Service Fabric supports a liveness probe mechanism for [containerized][containers-introduction-link] applications. A liveness probe helps to report the liveness of a containerized application, which will restart if it doesn't respond quickly.
10
12
This article provides an overview of how to define a liveness probe by using manifest files.
11
13
12
-
Before proceeding with this article, you should become familiar with the [Service Fabric application model][application-model-link] and the [Service Fabric hosting model][hosting-model-link].
14
+
Before you proceed with this article, become familiar with the [Service Fabric application model][application-model-link] and the [Service Fabric hosting model][hosting-model-link].
13
15
14
16
> [!NOTE]
15
-
> Liveness probe is only supported for containers on in network address translation mode.
17
+
> Liveness probe is supported only for containers in NAT networking mode.
16
18
17
19
## Semantics
18
20
You can specify only one liveness probe per container and can control its behavior by using these fields:
19
21
20
-
*`initialDelaySeconds`: The initial delay in seconds to start executing the probe once the container has started. The supported value is int (default: 0; minimum: 0).
22
+
*`initialDelaySeconds`: The initial delay in seconds to start executing the probe after the container has started. The supported value is **int**. The default is 0 and the minimum is 0.
21
23
22
-
*`timeoutSeconds`: The period in seconds after which the probe is considered to have failed, if it hasn't completed successfully. The supported value is int (default: 1; minimum: 1).
24
+
*`timeoutSeconds`: The period in seconds after which we consider the probe as failed, if it hasn't finished successfully. The supported value is **int**. The default is 1 and the minimum is 1.
23
25
24
-
*`periodSeconds`: The period in seconds to specify the frequency of the probe. The supported value is int (default: 10; minimum: 1).
26
+
*`periodSeconds`: The period in seconds to specify the frequency of the probe. The supported value is **int**. The default is 10 and the minimum is 1.
25
27
26
-
*`failureThreshold`: When this value is reached the container will restart. The supported value is int (default: 3; minimum: 1).
28
+
*`failureThreshold`: When we hit this value, the container will restart. The supported value is **int**. The default is 3 and the minimum is 1.
27
29
28
-
*`successThreshold`: On failure, for the probe to be considered successful, it has to execute successfully for this value. The supported value is int (default: 1; minimum: 1).
30
+
*`successThreshold`: On failure, for the probe to be considered successful, it has to run successfully for this value. The supported value is **int**. The default is 1 and the minimum is 1.
29
31
30
-
There can be, at most, one probe to one container at any moment in time. If the probe does not complete in the time set in **timeoutSeconds**, wait and count the time towards the **failureThreshold**.
32
+
There can be, at most, one probe to one container at any moment. If the probe doesn't finish in the time set in **timeoutSeconds**, wait and count the time toward the **failureThreshold**.
31
33
32
-
Additionally, Service Fabric will raise the following probe [Health Reports][health-introduction-link] on **DeployedServicePackage**:
34
+
Additionally, Service Fabric will raise the following probe [health reports][health-introduction-link] on **DeployedServicePackage**:
33
35
34
36
*`OK`: The probe succeeds for the value set in **successThreshold**.
35
37
36
38
*`Error`: The probe **failureCount** == **failureThreshold**, before the container restarts.
37
39
38
40
*`Warning`:
39
41
* The probe fails and **failureCount** < **failureThreshold**. This health report stays until **failureCount** reaches the value set in **failureThreshold** or **successThreshold**.
40
-
* On success post failure, the warning remains but with updated consecutive successes.
42
+
* On success after failure, the warning remains but with updated consecutive successes.
41
43
42
44
## Specifying a liveness probe
43
45
44
-
You can specify a probe in the ApplicationManifest.xml file under **ServiceManifestImport**:
46
+
You can specify a probe in the ApplicationManifest.xml file under **ServiceManifestImport**.
45
47
46
48
The probe can be for any of the following:
47
49
@@ -51,7 +53,7 @@ The probe can be for any of the following:
51
53
52
54
### HTTP probe
53
55
54
-
For an HTTP probe, Service Fabric will send an HTTP request to the port and path that you specify. A return code that is greater than, or equal to, 200 and less than 400 indicates success.
56
+
For an HTTP probe, Service Fabric will send an HTTP request to the port and path that you specify. A return code that is greater than or equal to 200, and less than 400, indicates success.
55
57
56
58
Here is an example of how to specify an HTTP probe:
57
59
@@ -74,21 +76,21 @@ Here is an example of how to specify an HTTP probe:
74
76
</ServiceManifestImport>
75
77
```
76
78
77
-
The HTTP probe has additional properties you can set as follows:
79
+
The HTTP probe has additional properties that you can set:
78
80
79
81
*`path`: The path to use in the HTTP request.
80
82
81
-
*`port`: The port to use for probes. The range is 1 to 65535 (mandatory).
83
+
*`port`: The port to use for probes. This property is mandatory. The range is 1 to 65535.
82
84
83
-
*`scheme`: The scheme to use for connecting to the code package. If this is set to HTTPS, the certificate verification is skipped. The default setting is HTTP.
85
+
*`scheme`: The scheme to use for connecting to the code package. If this property is set to HTTPS, the certificate verification is skipped. The default setting is HTTP.
84
86
85
87
*`httpHeader`: The headers to set in the request. You can specify multiple headers.
86
88
87
89
*`host`: The host IP address to connect to.
88
90
89
91
### TCP probe
90
92
91
-
For a TCP probe, Service Fabric will try to open a socket on the container by using the specified port. If it can establish a connection, the probe is considered successful. Here is an example of how to specify a probe that uses a TCP socket:
93
+
For a TCP probe, Service Fabric will try to open a socket on the container by using the specified port. If it can establish a connection, the probe is considered successful. Here's an example of how to specify a probe that uses a TCP socket:
92
94
93
95
```xml
94
96
<ServiceManifestImport>
@@ -108,11 +110,11 @@ For a TCP probe, Service Fabric will try to open a socket on the container by us
108
110
109
111
### Exec probe
110
112
111
-
This probe will issue an **exec** command into the container and wait for the command to complete.
113
+
This probe will issue an **exec** command into the container and wait for the command to finish.
112
114
113
115
> [!NOTE]
114
116
> **Exec** command takes a comma separated string. The command in the following example will work for a Linux container.
115
-
> If you are trying to probe a Windows container, use **cmd**.
117
+
> If you're trying to probe a Windows container, use **cmd**.
116
118
117
119
```xml
118
120
<ServiceManifestImport>
@@ -133,8 +135,8 @@ This probe will issue an **exec** command into the container and wait for the co
133
135
```
134
136
135
137
## Next steps
136
-
See the following articles for related information.
137
-
*[Service Fabric and containers.][containers-introduction-link]
138
+
See the following article for related information:
139
+
*[Service Fabric and containers][containers-introduction-link]
0 commit comments