Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

Commit

Permalink
Longer liveness check timeout, to avoid failure when cpu high (#232)
Browse files Browse the repository at this point in the history
Signed-off-by: shaoyue.chen <[email protected]>
  • Loading branch information
haorenfsa authored Mar 8, 2023
1 parent 2465f19 commit 7294c56
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
21 changes: 17 additions & 4 deletions pkg/controllers/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,22 @@ func GetStartupProbe() *corev1.Probe {
}

func GetLivenessProbe() *corev1.Probe {
return &corev1.Probe{
Handler: corev1.Handler{
HTTPGet: &corev1.HTTPGetAction{
Path: "/healthz",
Port: intstr.FromInt(9091),
Scheme: corev1.URISchemeHTTP,
},
},
TimeoutSeconds: 10,
PeriodSeconds: 15,
FailureThreshold: 3,
SuccessThreshold: 1,
}
}

func GetReadinessProbe() *corev1.Probe {
return &corev1.Probe{
Handler: corev1.Handler{
HTTPGet: &corev1.HTTPGetAction{
Expand All @@ -370,14 +386,11 @@ func GetLivenessProbe() *corev1.Probe {
},
},
TimeoutSeconds: 3,
PeriodSeconds: 30,
PeriodSeconds: 15,
FailureThreshold: 2,
SuccessThreshold: 1,
}
}

var GetReadinessProbe = GetLivenessProbe

func (c MilvusComponent) GetDeploymentStrategy(configs map[string]interface{}) appsv1.DeploymentStrategy {
var useRollingUpdate bool
switch {
Expand Down
4 changes: 3 additions & 1 deletion pkg/controllers/components_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,9 +373,11 @@ func TestMilvusComponent_GetLivenessProbe_GetReadinessProbe(t *testing.T) {
lProbe := GetLivenessProbe()
assert.Equal(t, "/healthz", lProbe.HTTPGet.Path)
assert.Equal(t, intstr.FromInt(MetricPort), lProbe.HTTPGet.Port)
assert.Equal(t, int32(10), lProbe.TimeoutSeconds)
assert.Equal(t, int32(15), lProbe.PeriodSeconds)

rProbe := GetReadinessProbe()
assert.Equal(t, lProbe, rProbe)
assert.Equal(t, int32(3), rProbe.TimeoutSeconds)
}

func TestMilvusComponent_GetDeploymentStrategy(t *testing.T) {
Expand Down

0 comments on commit 7294c56

Please sign in to comment.