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
+43-41Lines changed: 43 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,59 +1,61 @@
1
1
---
2
2
title: Azure Service Fabric probes
3
-
description: How to model Liveness Probe in Azure Service Fabric using application and service manifest files.
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
-
# Liveness Probe
9
-
Starting with 7.1Service Fabric supports Liveness Probe mechanism for [containerized][containers-introduction-link] applications. Liveness Probe help announce the liveness of the containerized application and when they do not respond in a timely fashion, it will result in a restart.
10
-
This article provides an overview of how to define a Liveness Probe via manifest files.
10
+
# Liveness probe
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.
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, we recommend getting 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 NAT networking mode.
17
+
> Liveness probe is supported only for containers in NAT networking mode.
16
18
17
19
## Semantics
18
-
You can specify only 1 Liveness Probe per container and can control it's behavior with these fields:
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 probe once container has started. Supported value is int. Default is 0. Minimum is 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`: Period in seconds after which we consider probe as failed if it hasn't completed successfully. Supported value is int. Default is 1. Minimum is 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`: Period in seconds to specify how often we probe. Supported value is int. Default is 10. Minimum is 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`: Once we hit FailureThreshold, container will restart. Supported value is int. Default is 3. Minimum is 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 probe to be considered success it has to execute successfully for SuccessThreshold. Supported value is int. Default is 1. Minimum is 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 will be at most 1 probe to container at one moment of time. If the probe does not complete in **timeoutSeconds** we keep waiting and counting it 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, ServiceFabric will raise 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
-
*`Ok`: If the probe succeeds for **successThreshold** then we report health as Ok.
36
+
*`OK`: The probe succeeds for the value set in **successThreshold**.
35
37
36
-
*`Error`: If the probe failureCount == **failureThreshold**, before restarting the container we report Error.
38
+
*`Error`: The probe **failureCount** == **failureThreshold**, before the container restarts.
37
39
38
40
*`Warning`:
39
-
1. If the probe fails and the failureCount < **failureThreshold** we report Warning. This health report stays until failureCount reaches **failureThreshold** or **successThreshold**.
40
-
2. On success post failure, we still report Warning but with updated consecutive success.
41
+
* The probe fails and **failureCount** < **failureThreshold**. This health report stays until **failureCount** reaches the value set in**failureThreshold** or **successThreshold**.
42
+
* On success after failure, the warning remains but with updated consecutive successes.
41
43
42
-
## Specifying Liveness Probe
44
+
## Specifying a liveness probe
43
45
44
-
You can specify probe in the ApplicationManifest.xml under ServiceManifestImport:
46
+
You can specify a probe in the ApplicationManifest.xml file under **ServiceManifestImport**.
45
47
46
-
Probe can either one of :
48
+
The probe can be for any of the following:
47
49
48
-
1. HTTP
49
-
2. TCP
50
-
3. Exec
50
+
* HTTP
51
+
* TCP
52
+
* Exec
51
53
52
-
## HTTP Probe
54
+
###HTTP probe
53
55
54
-
For HTTP probe, Service Fabric will send an HTTP request to the port and path specified. Return code 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
-
Here is an example of how to specify HttpGet probe:
58
+
Here is an example of how to specify an HTTP probe:
57
59
58
60
```xml
59
61
<ServiceManifestImport>
@@ -74,21 +76,21 @@ Here is an example of how to specify HttpGet probe:
74
76
</ServiceManifestImport>
75
77
```
76
78
77
-
HttpGet probe has additional properties you can set:
79
+
The HTTP probe has additional properties that you can set:
78
80
79
-
*`path`: Path to access on the HTTP request.
81
+
*`path`: The path to use in the HTTP request.
80
82
81
-
*`port`: Port to access for probes. 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`: Scheme to use for connecting to code package. If set to HTTPS, certificate verification is skipped. Defaults to 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
-
*`httpHeader`: Headers to set in the request. You can specify multiple of these.
87
+
*`httpHeader`: The headers to set in the request. You can specify multiple headers.
86
88
87
-
*`host`: Host IP to connect to.
89
+
*`host`: The host IP address to connect to.
88
90
89
-
## TCP Probe
91
+
###TCP probe
90
92
91
-
For TCP probe, Service Fabric will try to open a socket on the container with the specified port. If it can establish a connection, the probe is considered success. Here is an example of how to specify probe which uses 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>
@@ -106,13 +108,13 @@ For TCP probe, Service Fabric will try to open a socket on the container with th
106
108
</ServiceManifestImport>
107
109
```
108
110
109
-
## Exec Probe
111
+
###Exec probe
110
112
111
-
This probe will issue an execinto 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
-
> Exec command takes a comma seperated string. The following command in the example will work for Linux container.
115
-
> If you are trying windows container, use <Command>cmd</Command>
116
+
> **Exec** command takes a comma separated string. The command in the following example will work for a Linux container.
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 into the container and wait for the command to com
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