From 9b0f4fb5813e49fb533aa99479a53c9592541a6b Mon Sep 17 00:00:00 2001 From: Steven Hawkins Date: Wed, 26 Jul 2023 04:48:54 -0400 Subject: [PATCH] Removes the initial delay seconds and adds a startup probe (#21884) Adjusted the thresholds and delays accordingly Closes #21111 --- .../controllers/KeycloakDeployment.java | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/operator/src/main/java/org/keycloak/operator/controllers/KeycloakDeployment.java b/operator/src/main/java/org/keycloak/operator/controllers/KeycloakDeployment.java index 94667bba1a..79ff34e3e2 100644 --- a/operator/src/main/java/org/keycloak/operator/controllers/KeycloakDeployment.java +++ b/operator/src/main/java/org/keycloak/operator/controllers/KeycloakDeployment.java @@ -241,9 +241,8 @@ public class KeycloakDeployment extends OperatorManagedResource imp if (!containerBuilder.hasReadinessProbe()) { containerBuilder.withNewReadinessProbe() - .withInitialDelaySeconds(20) - .withPeriodSeconds(2) - .withFailureThreshold(250) + .withPeriodSeconds(10) + .withFailureThreshold(3) .withNewHttpGet() .withScheme(protocol) .withNewPort(kcPort) @@ -253,9 +252,8 @@ public class KeycloakDeployment extends OperatorManagedResource imp } if (!containerBuilder.hasLivenessProbe()) { containerBuilder.withNewLivenessProbe() - .withInitialDelaySeconds(20) - .withPeriodSeconds(2) - .withFailureThreshold(150) + .withPeriodSeconds(10) + .withFailureThreshold(3) .withNewHttpGet() .withScheme(protocol) .withNewPort(kcPort) @@ -263,6 +261,17 @@ public class KeycloakDeployment extends OperatorManagedResource imp .endHttpGet() .endLivenessProbe(); } + if (!containerBuilder.hasStartupProbe()) { + containerBuilder.withNewStartupProbe() + .withPeriodSeconds(1) + .withFailureThreshold(600) + .withNewHttpGet() + .withScheme(protocol) + .withNewPort(kcPort) + .withPath(kcRelativePath + "health/started") + .endHttpGet() + .endStartupProbe(); + } // add in ports - there's no merging being done here StatefulSet baseDeployment = containerBuilder