Skip to content

Commit 60dc1b6

Browse files
authored
Merge pull request #84730 from ochromy/SRVKS-1257
[SRVKS-1257] Add startup probes documentation
2 parents 06c26a3 + 81606d5 commit 60dc1b6

File tree

5 files changed

+121
-0
lines changed

5 files changed

+121
-0
lines changed

_topic_maps/_topic_map.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ Topics:
134134
File: pvcs-for-serving
135135
- Name: Init containers
136136
File: init-containers
137+
- Name: Startup probes
138+
File: startup-probes-for-serving
137139
- Name: Resolving image tags to digests
138140
File: resolving-image-tags-to-digests
139141
- Name: Configuring Kourier
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
:_content-type: ASSEMBLY
2+
include::_attributes/common-attributes.adoc[]
3+
[id="startup-probes-for-serving"]
4+
= Startup probes
5+
:context: startup-probes-for-serving
6+
7+
toc::[]
8+
9+
Startup probes verify whether a service has started successfully, helping to reduce cold start times for containers with slow startup processes.
10+
Startup probes run only during the container's initialization phase and do not execute periodically. If a startup probe fails, the container adheres to the defined `restartPolicy`.
11+
12+
//TODO: architecture diagram
13+
14+
//Progress Deadline
15+
include::modules/serverless-progress-deadline-serving.adoc[leveloffset=+1]
16+
17+
// Configuring Startup Probes
18+
include::modules/serverless-configuring-startup-probing-serving.adoc[leveloffset=+1]
19+
20+
//Configuring Progress Deadline
21+
include::modules/serverless-configuring-progress-deadline-serving.adoc[leveloffset=+1]
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * serverless/knative-serving/config-applications/startup-probes-for-serving.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="serverless-configuring-progress-deadline-serving_{context}"]
7+
= Configuring the progress deadline
8+
9+
You can configure progress deadline settings to specify the maximum time allowed for your deployment to progress before the system reports a failure for the Knative Revision. This time limit can be specified in seconds or minutes.
10+
11+
To configure the progress deadline effectively, consider the following parameters:
12+
13+
* `initialDelaySeconds`
14+
* `failureThreshold`
15+
* `periodSeconds`
16+
* `timeoutSeconds`
17+
18+
If the initial scale is not achieved within the specified time limit, the Knative Autoscaler component scales the revision to `0`, and the Knative service enters a terminal `Failed` state.
19+
20+
By default, the progress deadline is set to 600 seconds. This value is specified as a Golang `time.Duration` string and must be rounded to the nearest second.
21+
22+
.Procedure
23+
24+
* To configure the progress deadline setting, use an annotation in your deployment configuration.
25+
+
26+
.Example of progress deadline set to 60 seconds
27+
[source,yaml]
28+
----
29+
apiVersion: serving.knative.dev/v1
30+
kind: Service
31+
...
32+
spec:
33+
template:
34+
metadata:
35+
annotations:
36+
serving.knative.dev/progress-deadline: "60s"
37+
spec:
38+
containers:
39+
- image: ghcr.io/knative/helloworld-go:latest
40+
----
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * serverless/knative-serving/config-applications/startup-probes-for-serving.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="serverless-configuring-startup-probing-serving_{context}"]
7+
= Configuring startup probing
8+
9+
For {ServerlessProductName} Serving, startup probes are not defined by default. You can define startup probes for your containers in your deployment configuration.
10+
11+
.Procedure
12+
13+
* Define startup probes for your service by modifying your deployment configuration. The following example shows a configuration with two containers:
14+
+
15+
.Example of defined starup probes
16+
[source,yaml]
17+
----
18+
apiVersion: serving.knative.dev/v1
19+
kind: Service
20+
# ...
21+
spec:
22+
template:
23+
spec:
24+
containers:
25+
- name: first-container
26+
image: <image>
27+
ports:
28+
- containerPort: 8080
29+
# ...
30+
startupProbe: <1>
31+
httpGet:
32+
port: 8080
33+
path: "/"
34+
- name: second-container
35+
image: <image>
36+
# ...
37+
startupProbe: <2>
38+
httpGet:
39+
port: 8081
40+
path: "/"
41+
----
42+
<1> Startup probe of the `first-container`.
43+
<2> Startup probe of the `second-container`.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * serverless/knative-serving/config-applications/startup-probes-for-serving.adoc
4+
5+
:_content-type: CONCEPT
6+
[id="serverless-progress-deadline-serving_{context}"]
7+
= Progress deadline
8+
9+
By default, services have a progress deadline that defines the time limit for a service to complete its initial startup. When using startup probes, ensure that the progress deadline is set to exceed the maximum time required by the startup probes. If the progress deadline is set too low, the startup probes might not finish before the deadline is reached, which can prevent the service from starting.
10+
11+
Consider increasing the progress deadline if you encounter any of these conditions in your deployment:
12+
13+
* The service image takes a long time to pull due to its size.
14+
* The service takes a long time to become `READY` because of initial cache priming.
15+
* The cluster relies on autoscaling to allocate resources for new pods.

0 commit comments

Comments
 (0)