Skip to content
This repository was archived by the owner on May 14, 2025. It is now read-only.

Commit eb747af

Browse files
author
Corneil du Plessis
authored
Improving default probes. (#5686)
1 parent 16f7cc4 commit eb747af

File tree

4 files changed

+21
-12
lines changed

4 files changed

+21
-12
lines changed

spring-cloud-dataflow-docs/src/main/asciidoc/configuration-kubernetes-app-properties.adoc

+8-3
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ This overrides the JVM memory setting for the desired `<application>` (replace `
104104
[[getting-started-kubernetes-probes]]
105105
==== Liveness, Readiness and Startup Probes
106106

107-
The `liveness` and `readiness` probes use paths called `/health` and `/info`, respectively. They use a `delay` of `1` for both and a `period` of `60` and `10` respectively. You can change these defaults when you deploy the stream by using deployer properties. The liveness and readiness probes are applied only to streams.
107+
The `liveness` and `readiness` probes use paths called `/health/liveness` and `/health/readiness`, respectively. They use a `delay` of `1` for both and a `period` of `60` and `10` respectively. You can change these defaults when you deploy the stream by using deployer properties. The liveness and readiness probes are applied only to streams.
108108

109109
The `startup` probe will use the `/health` path and a delay of 30 and period for 3 with a failure threshold of 20 times before the container restarts the application.
110110

@@ -113,11 +113,16 @@ The following example changes the `liveness` and `startup` probes (replace `<app
113113
====
114114
[source]
115115
----
116-
deployer.<application>.kubernetes.livenessProbePath=/health
116+
deployer.<application>.kubernetes.livenessProbePath=/health/livesness
117117
deployer.<application>.kubernetes.livenessProbeDelay=1
118118
deployer.<application>.kubernetes.livenessProbePeriod=60
119119
deployer.<application>.kubernetes.livenessProbeSuccess=1
120120
deployer.<application>.kubernetes.livenessProbeFailure=3
121+
deployer.<application>.kubernetes.readinessProbePath=/health/readiness
122+
deployer.<application>.kubernetes.readinessProbeDelay=1
123+
deployer.<application>.kubernetes.readinessProbePeriod=60
124+
deployer.<application>.kubernetes.readinessProbeSuccess=1
125+
deployer.<application>.kubernetes.readinessProbeFailure=3
121126
deployer.<application>.kubernetes.startupHttpProbePath=/health
122127
deployer.<application>.kubernetes.startupProbedelay=20
123128
deployer.<application>.kubernetes.startupProbeSuccess=1
@@ -142,7 +147,7 @@ data:
142147
kubernetes:
143148
accounts:
144149
default:
145-
livenessHttpProbePath: /health
150+
livenessHttpProbePath: /health/liveness
146151
livenessProbeDelay: 1
147152
livenessProbePeriod: 60
148153
livenessProbeSuccess: 1

src/carvel/config/dataflow.star

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@ def has_context_path():
9696
end
9797

9898
def dataflow_liveness_path():
99-
return data.values.scdf.server.contextPath + "/management/health"
99+
return data.values.scdf.server.contextPath + "/management/health/liveness"
100100
end
101101

102102
def dataflow_readiness_path():
103-
return data.values.scdf.server.contextPath + "/management/info"
103+
return data.values.scdf.server.contextPath + "/management/health/readiness"
104104
end
105105

106106
def dataflow_has_password():

src/carvel/test/servers.test.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -535,8 +535,8 @@ describe('servers', () => {
535535

536536
const dataflowDeployment = findDeployment(yaml, SCDF_SERVER_NAME);
537537
const dataflowContainer = deploymentContainer(dataflowDeployment, SCDF_SERVER_NAME);
538-
expect(dataflowContainer?.livenessProbe?.httpGet?.path).toBe('/management/health');
539-
expect(dataflowContainer?.readinessProbe?.httpGet?.path).toBe('/management/info');
538+
expect(dataflowContainer?.livenessProbe?.httpGet?.path).toBe('/management/health/liveness');
539+
expect(dataflowContainer?.readinessProbe?.httpGet?.path).toBe('/management/health/readiness');
540540
});
541541

542542
it('should change server servlet context path', async () => {
@@ -556,8 +556,8 @@ describe('servers', () => {
556556

557557
const dataflowDeployment = findDeployment(yaml, SCDF_SERVER_NAME);
558558
const dataflowContainer = deploymentContainer(dataflowDeployment, SCDF_SERVER_NAME);
559-
expect(dataflowContainer?.livenessProbe?.httpGet?.path).toBe('/scdf/management/health');
560-
expect(dataflowContainer?.readinessProbe?.httpGet?.path).toBe('/scdf/management/info');
559+
expect(dataflowContainer?.livenessProbe?.httpGet?.path).toBe('/scdf/management/health/liveness');
560+
expect(dataflowContainer?.readinessProbe?.httpGet?.path).toBe('/scdf/management/health/readiness');
561561
});
562562

563563
it('should have default resources', async () => {

src/deploy/carvel/register-apps.sh

+7-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ start_time=$(date +%s)
1111
function register_app() {
1212
set +e
1313
echo "Registering $1 as $2"
14-
wget -q -O- "$DATAFLOW_URL/apps/$1" --post-data="uri=$2"
14+
DATA="uri=$2"
15+
if [ "$3" != "" ]; then
16+
DATA="$DATA&$3"
17+
fi
18+
wget -q -O- "$DATAFLOW_URL/apps/$1" --post-data="$DATA"
1519
RC=$?
1620
if ((RC > 0)); then
1721
echo "Error registering $1: $RC"
@@ -85,8 +89,8 @@ wget -qO- "$DATAFLOW_URL/apps" --post-data="uri=$TASK_URI"
8589
# replace with individual calls to register only what is required.
8690
#register_app "task/timestamp" "docker:springcloudtask/timestamp-task:2.0.2"
8791
#register_app "task/timestamp-batch" "docker:springcloudtask/timestamp-batch-task:2.0.2"
88-
register_app "task/timestamp3" "docker:springcloudtask/timestamp-task:3.0.0"
89-
register_app "task/timestamp-batch3" "docker:springcloudtask/timestamp-batch-task:3.0.0"
92+
register_app "task/timestamp3" "docker:springcloudtask/timestamp-task:3.0.0" "bootVersion=3"
93+
register_app "task/timestamp-batch3" "docker:springcloudtask/timestamp-batch-task:3.0.0" "bootVersion=3"
9094
register_app "task/task-demo-metrics-prometheus" "docker:springcloudtask/task-demo-metrics-prometheus:2.0.1-SNAPSHOT"
9195

9296
end_time=$(date +%s)

0 commit comments

Comments
 (0)