Skip to content

Commit

Permalink
[health] use dbnode health/bootstrap endpoints
Browse files Browse the repository at this point in the history
Now that M3DB exposes health and bootstrapped endpoints immediately we
can leverage those rather than the crazy health check script.
  • Loading branch information
schallert committed May 24, 2019
1 parent 148f53c commit f02e871
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
4 changes: 1 addition & 3 deletions pkg/k8sops/generators.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,8 @@ const (
_probeInitialDelaySeconds = 10
_probeFailureThreshold = 15

// TODO(schallert): switch to dbnode's endpoint instead of coordinator after
// https://github.com/m3db/m3/issues/996
_probePort = 7201
_probePathHealth = "/health"
_probePathReady = "/bootstrappedinplacementornoplacement"

_dataDirectory = "/var/lib/m3db/"
_dataVolumeName = "m3db-data"
Expand Down
8 changes: 5 additions & 3 deletions pkg/k8sops/generators_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func TestGenerateStatefulSet(t *testing.T) {
FailureThreshold: _probeFailureThreshold,
Handler: v1.Handler{
HTTPGet: &v1.HTTPGetAction{
Port: intstr.FromInt(_probePort),
Port: intstr.FromInt(PortM3DBHTTPNode),
Path: _probePathHealth,
Scheme: v1.URISchemeHTTP,
},
Expand All @@ -95,8 +95,10 @@ func TestGenerateStatefulSet(t *testing.T) {
InitialDelaySeconds: _probeInitialDelaySeconds,
FailureThreshold: _probeFailureThreshold,
Handler: v1.Handler{
Exec: &v1.ExecAction{
Command: []string{_healthFileName},
HTTPGet: &v1.HTTPGetAction{
Port: intstr.FromInt(PortM3DBHTTPNode),
Path: _probePathReady,
Scheme: v1.URISchemeHTTP,
},
},
}
Expand Down
8 changes: 5 additions & 3 deletions pkg/k8sops/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func NewBaseStatefulSet(ssName, isolationGroup string, cluster *myspec.M3DBClust
FailureThreshold: _probeFailureThreshold,
Handler: v1.Handler{
HTTPGet: &v1.HTTPGetAction{
Port: intstr.FromInt(_probePort),
Port: intstr.FromInt(PortM3DBHTTPNode),
Path: _probePathHealth,
Scheme: v1.URISchemeHTTP,
},
Expand All @@ -83,8 +83,10 @@ func NewBaseStatefulSet(ssName, isolationGroup string, cluster *myspec.M3DBClust
InitialDelaySeconds: _probeInitialDelaySeconds,
FailureThreshold: _probeFailureThreshold,
Handler: v1.Handler{
Exec: &v1.ExecAction{
Command: []string{_healthFileName},
HTTPGet: &v1.HTTPGetAction{
Port: intstr.FromInt(PortM3DBHTTPNode),
Path: _probePathReady,
Scheme: v1.URISchemeHTTP,
},
},
}
Expand Down

0 comments on commit f02e871

Please sign in to comment.