Skip to content

Commit

Permalink
feat: add startup probes to controller-manager and scheduler
Browse files Browse the repository at this point in the history
Add startup probes that probe the containers for 60 seconds before switching to liveness probes.

Closes #7054.

Signed-off-by: Utku Ozdemir <utku.ozdemir@siderolabs.com>
(cherry picked from commit 103f0ff)
  • Loading branch information
utkuozdemir authored and smira committed Apr 27, 2023
1 parent 9ce2387 commit 0ef6051
Showing 1 changed file with 30 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,20 @@ func (ctrl *ControlPlaneStaticPodController) manageControllerManager(ctx context
ReadOnly: true,
},
}, volumeMounts(cfg.ExtraVolumes)...),
StartupProbe: &v1.Probe{
ProbeHandler: v1.ProbeHandler{
HTTPGet: &v1.HTTPGetAction{
Path: "/healthz",
Host: "localhost",
Port: intstr.FromInt(10257),
Scheme: v1.URISchemeHTTPS,
},
},
// Give 60 seconds for the container to start up
PeriodSeconds: 5,
FailureThreshold: 12,
TerminationGracePeriodSeconds: nil,
},
LivenessProbe: &v1.Probe{
ProbeHandler: v1.ProbeHandler{
HTTPGet: &v1.HTTPGetAction{
Expand All @@ -578,8 +592,7 @@ func (ctrl *ControlPlaneStaticPodController) manageControllerManager(ctx context
Scheme: v1.URISchemeHTTPS,
},
},
InitialDelaySeconds: 15,
TimeoutSeconds: 15,
TimeoutSeconds: 15,
},
Resources: v1.ResourceRequirements{
Requests: v1.ResourceList{
Expand Down Expand Up @@ -689,6 +702,20 @@ func (ctrl *ControlPlaneStaticPodController) manageScheduler(ctx context.Context
ReadOnly: true,
},
}, volumeMounts(cfg.ExtraVolumes)...),
StartupProbe: &v1.Probe{
ProbeHandler: v1.ProbeHandler{
HTTPGet: &v1.HTTPGetAction{
Path: "/healthz",
Host: "localhost",
Port: intstr.FromInt(10259),
Scheme: v1.URISchemeHTTPS,
},
},
// Give 60 seconds for the container to start up
PeriodSeconds: 5,
FailureThreshold: 12,
TerminationGracePeriodSeconds: nil,
},
LivenessProbe: &v1.Probe{
ProbeHandler: v1.ProbeHandler{
HTTPGet: &v1.HTTPGetAction{
Expand All @@ -698,8 +725,7 @@ func (ctrl *ControlPlaneStaticPodController) manageScheduler(ctx context.Context
Scheme: v1.URISchemeHTTPS,
},
},
InitialDelaySeconds: 15,
TimeoutSeconds: 15,
TimeoutSeconds: 15,
},
Resources: v1.ResourceRequirements{
Requests: v1.ResourceList{
Expand Down

0 comments on commit 0ef6051

Please sign in to comment.