Skip to content

Commit

Permalink
liveness/readiness for hosted-cluster-config-operator
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-topchiev committed Nov 19, 2021
1 parent 5d8dabb commit 3832625
Showing 1 changed file with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (

corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
"k8s.io/apimachinery/pkg/util/intstr"

hyperv1 "github.com/openshift/hypershift/api/v1alpha1"
"github.com/openshift/hypershift/control-plane-operator/controllers/hostedcontrolplane/config"
Expand Down Expand Up @@ -40,6 +41,38 @@ func NewHostedClusterConfigOperatorParams(ctx context.Context, hcp *hyperv1.Host
},
},
}
params.LivenessProbes = config.LivenessProbes{
hccContainerMain().Name: {
Handler: corev1.Handler{
HTTPGet: &corev1.HTTPGetAction{
Path: "/metrics",
Port: intstr.FromInt(8080),
Scheme: corev1.URISchemeHTTP,
},
},
InitialDelaySeconds: 60,
PeriodSeconds: 60,
SuccessThreshold: 1,
FailureThreshold: 5,
TimeoutSeconds: 5,
},
}
params.ReadinessProbes = config.ReadinessProbes{
hccContainerMain().Name: {
Handler: corev1.Handler{
HTTPGet: &corev1.HTTPGetAction{
Path: "/metrics",
Port: intstr.FromInt(8080),
Scheme: corev1.URISchemeHTTP,
},
},
InitialDelaySeconds: 15,
PeriodSeconds: 60,
SuccessThreshold: 1,
FailureThreshold: 3,
TimeoutSeconds: 5,
},
}
params.DeploymentConfig.SetColocation(hcp)
params.DeploymentConfig.SetRestartAnnotation(hcp.ObjectMeta)
params.DeploymentConfig.SetControlPlaneIsolation(hcp)
Expand Down

0 comments on commit 3832625

Please sign in to comment.