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

Commit 030048c

Browse files
author
Corneil du Plessis
committed
Add support for Startup Probe.
Add support for probe failure and success thresholds. Ensure all probe properties can use probe specific value before generic deprecated values.
1 parent 8c5b1dd commit 030048c

20 files changed

+7825
-7047
lines changed

pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
<maven.compiler.plugin.version>3.8.0</maven.compiler.plugin.version>
2424
<powermock.version>2.0.2</powermock.version>
2525
<okhttp.version>3.14.9</okhttp.version>
26+
<fabric8-kubernetes-client.version>5.12.2</fabric8-kubernetes-client.version>
2627
</properties>
2728

2829

@@ -48,6 +49,7 @@
4849
<dependency>
4950
<groupId>io.fabric8</groupId>
5051
<artifactId>kubernetes-client</artifactId>
52+
<version>${fabric8-kubernetes-client.version}</version>
5153
</dependency>
5254
<dependency>
5355
<groupId>org.hashids</groupId>

src/main/java/org/springframework/cloud/deployer/spi/kubernetes/CommandProbeCreator.java

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,27 @@
2424
* Base class for command based probe creators
2525
*
2626
* @author Chris Schaefer
27+
* @author Corneil du Plessis
2728
* @since 2.5
2829
*/
2930
abstract class CommandProbeCreator extends ProbeCreator {
30-
CommandProbeCreator(KubernetesDeployerProperties kubernetesDeployerProperties,
31-
ContainerConfiguration containerConfiguration) {
32-
super(kubernetesDeployerProperties, containerConfiguration);
33-
}
31+
CommandProbeCreator(KubernetesDeployerProperties kubernetesDeployerProperties,
32+
ContainerConfiguration containerConfiguration) {
33+
super(kubernetesDeployerProperties, containerConfiguration);
34+
}
3435

35-
abstract String[] getCommand();
36+
abstract String[] getCommand();
3637

37-
protected Probe create() {
38-
ExecActionBuilder execActionBuilder = new ExecActionBuilder()
39-
.withCommand(getCommand());
38+
protected Probe create() {
39+
ExecActionBuilder execActionBuilder = new ExecActionBuilder()
40+
.withCommand(getCommand());
4041

41-
return new ProbeBuilder()
42-
.withExec(execActionBuilder.build())
43-
.withInitialDelaySeconds(getInitialDelay())
44-
.withPeriodSeconds(getPeriod())
45-
.build();
46-
}
42+
return new ProbeBuilder()
43+
.withExec(execActionBuilder.build())
44+
.withInitialDelaySeconds(getInitialDelay())
45+
.withPeriodSeconds(getPeriod())
46+
.withSuccessThreshold(getSuccess())
47+
.withFailureThreshold(getFailure())
48+
.build();
49+
}
4750
}

0 commit comments

Comments
 (0)