Skip to content

Commit

Permalink
don't set probes when debug=true (#399)
Browse files Browse the repository at this point in the history
Signed-off-by: Michal Vala <mvala@redhat.com>
  • Loading branch information
sparkoo committed Aug 13, 2020
1 parent b371337 commit 6117383
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions pkg/deploy/deployment_che.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,24 +189,6 @@ func getSpecCheDeployment(checluster *orgv1.CheCluster, cmResourceVersion string
corev1.ResourceMemory: resource.MustParse(memLimit),
},
},
LivenessProbe: &corev1.Probe{
Handler: corev1.Handler{
HTTPGet: &corev1.HTTPGetAction{
Path: "/api/system/state",
Port: intstr.IntOrString{
Type: intstr.Int,
IntVal: int32(8080),
},
Scheme: corev1.URISchemeHTTP,
},
},
// After POD start, don't initiate liveness probe while the POD is still expected to be declared as ready by the readiness probe
InitialDelaySeconds: 200,
FailureThreshold: 3,
TimeoutSeconds: 3,
PeriodSeconds: 10,
SuccessThreshold: 1,
},
EnvFrom: []corev1.EnvFromSource{
{
ConfigMapRef: &corev1.ConfigMapEnvSource{
Expand Down Expand Up @@ -285,7 +267,7 @@ func getSpecCheDeployment(checluster *orgv1.CheCluster, cmResourceVersion string
}}
}

// configure readiness probe if debug isn't set
// configure probes if debug isn't set
cheDebug := util.GetValue(checluster.Spec.Server.CheDebug, DefaultCheDebug)
if cheDebug != "true" {
deployment.Spec.Template.Spec.Containers[0].ReadinessProbe = &corev1.Probe{
Expand All @@ -307,6 +289,24 @@ func getSpecCheDeployment(checluster *orgv1.CheCluster, cmResourceVersion string
PeriodSeconds: 10,
SuccessThreshold: 1,
}
deployment.Spec.Template.Spec.Containers[0].LivenessProbe = &corev1.Probe{
Handler: corev1.Handler{
HTTPGet: &corev1.HTTPGetAction{
Path: "/api/system/state",
Port: intstr.IntOrString{
Type: intstr.Int,
IntVal: int32(8080),
},
Scheme: corev1.URISchemeHTTP,
},
},
// After POD start, don't initiate liveness probe while the POD is still expected to be declared as ready by the readiness probe
InitialDelaySeconds: 200,
FailureThreshold: 3,
TimeoutSeconds: 3,
PeriodSeconds: 10,
SuccessThreshold: 1,
}
}

if !isOpenShift {
Expand Down

0 comments on commit 6117383

Please sign in to comment.