Skip to content

Commit 4c2d5e3

Browse files
committed
Readiness and liveness probing on a multi-container service
Review feedback for SRVKS-1220
1 parent e91e2e6 commit 4c2d5e3

File tree

2 files changed

+70
-0
lines changed

2 files changed

+70
-0
lines changed

knative-serving/config-applications/multi-container-support-for-serving.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ You can deploy a multi-container pod by using a single Knative service. This met
88

99
// Multi-container support
1010
include::modules/serverless-configuring-multi-container-service.adoc[leveloffset=+1]
11+
12+
// Probing a multi-container service
13+
include::modules/serverless-probing-multi-container-service.adoc[leveloffset=+1]
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * serverless/knative-serving/config-applications/multi-container-support-for-serving.adoc
4+
5+
6+
:_content-type: PROCEDURE
7+
[id="serverless-probing-multi-container-service_{context}"]
8+
= Probing a multi-container service
9+
10+
11+
You can specify readiness and liveness probes for multiple containers. This feature is not enabled by default and you must configure it using the `KnativeServing` custom resource (CR).
12+
13+
14+
.Procedure
15+
16+
17+
. Configure multi-container probing for your service by enabling the `multi-container-probing` feature in the `KnativeServing` CR.
18+
+
19+
.Multi-container probing configuration
20+
[source,yaml]
21+
----
22+
...
23+
spec:
24+
config:
25+
features:
26+
"multi-container-probing": enabled <1>
27+
...
28+
----
29+
<1> Enabled multi-container-probing feature
30+
31+
. Apply the updated `KnativeServing` CR.
32+
+
33+
[source,terminal]
34+
----
35+
$ oc apply -f <filename>
36+
----
37+
. Modify your multi-container service to include the specified probes.
38+
+
39+
.Multi-container probing
40+
[source,yaml]
41+
----
42+
apiVersion: serving.knative.dev/v1
43+
kind: Service
44+
...
45+
spec:
46+
template:
47+
spec:
48+
containers:
49+
- name: first-container
50+
image: ghcr.io/knative/helloworld-go:latest
51+
ports:
52+
- containerPort: 8080
53+
readinessProbe: <1>
54+
httpGet:
55+
port: 8080
56+
- name: second-container
57+
image: gcr.io/knative-samples/helloworld-java
58+
readinessProbe: <2>
59+
httpGet:
60+
port: 8090
61+
----
62+
<1> Readiness probe of the first container
63+
<2> Readiness probe of the second container
64+
65+
== Additional resources
66+
* link:https://knative.dev/docs/serving/services/configure-probing/#general-understanding-of-knative-probing[General understanding of Knative Probing]
67+

0 commit comments

Comments
 (0)