Skip to content

Commit

Permalink
[k8sops] Remove liveness probes from DB (#286)
Browse files Browse the repository at this point in the history
We already use readiness probes to make sure dbnodes are bootstrapped
before taking various actions. Liveness probes are usually a good idea,
but in the case of the DB we'd rather a deadlocked node remain up so we
can debug vs. automatically killing it.
  • Loading branch information
schallert authored Apr 26, 2021
1 parent 5d3e770 commit 3259a9c
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 33 deletions.
3 changes: 1 addition & 2 deletions pkg/k8sops/m3db/generators.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ const (
_probeInitialDelaySeconds = 10
_probeFailureThreshold = 15

_probePathHealth = "/health"
_probePathReady = "/bootstrappedinplacementornoplacement"
_probePathReady = "/bootstrappedinplacementornoplacement"

_dataDirectory = "/var/lib/m3db/"
_dataVolumeName = "m3db-data"
Expand Down
14 changes: 0 additions & 14 deletions pkg/k8sops/m3db/generators_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,6 @@ func TestGenerateStatefulSet(t *testing.T) {

ssName := StatefulSetName(clusterName, 0)

health := &v1.Probe{
TimeoutSeconds: _probeTimeoutSeconds,
InitialDelaySeconds: _probeInitialDelaySeconds,
FailureThreshold: _probeFailureThreshold,
Handler: v1.Handler{
HTTPGet: &v1.HTTPGetAction{
Port: intstr.FromInt(PortM3DBHTTPNode),
Path: _probePathHealth,
Scheme: v1.URISchemeHTTP,
},
},
}

readiness := &v1.Probe{
TimeoutSeconds: _probeTimeoutSeconds,
InitialDelaySeconds: _probeInitialDelaySeconds,
Expand Down Expand Up @@ -172,7 +159,6 @@ func TestGenerateStatefulSet(t *testing.T) {
Containers: []v1.Container{
{
Name: ssName,
LivenessProbe: health,
ReadinessProbe: readiness,
SecurityContext: &v1.SecurityContext{
RunAsUser: pointer.Int64Ptr(20),
Expand Down
17 changes: 0 additions & 17 deletions pkg/k8sops/m3db/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,22 +66,6 @@ func NewBaseStatefulSet(ssName, isolationGroup string, cluster *myspec.M3DBClust

objAnnotations := annotations.PodAnnotations(cluster)

// TODO(schallert): we're currently using the health of the coordinator for
// liveness probes until https://github.com/m3db/m3/issues/996 is fixed. Move
// to the dbnode's health endpoint once fixed.
probeHealth := &v1.Probe{
TimeoutSeconds: _probeTimeoutSeconds,
InitialDelaySeconds: _probeInitialDelaySeconds,
FailureThreshold: _probeFailureThreshold,
Handler: v1.Handler{
HTTPGet: &v1.HTTPGetAction{
Port: intstr.FromInt(PortM3DBHTTPNode),
Path: _probePathHealth,
Scheme: v1.URISchemeHTTP,
},
},
}

probeReady := &v1.Probe{
TimeoutSeconds: _probeTimeoutSeconds,
InitialDelaySeconds: _probeInitialDelaySeconds,
Expand Down Expand Up @@ -110,7 +94,6 @@ func NewBaseStatefulSet(ssName, isolationGroup string, cluster *myspec.M3DBClust
Name: ssName,
SecurityContext: specSecurityCtx,
ReadinessProbe: probeReady,
LivenessProbe: probeHealth,
Command: []string{
"m3dbnode",
},
Expand Down

0 comments on commit 3259a9c

Please sign in to comment.