Skip to content

Commit

Permalink
Merge pull request metal3-io#695 from dhellmann/health-monitor-endpoint
Browse files Browse the repository at this point in the history
add health check endpoint
  • Loading branch information
metal3-io-bot authored Oct 27, 2020
2 parents 226c982 + fb18335 commit 28a0c53
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,9 @@ spec:
cpu: 100m
memory: 20Mi
terminationGracePeriodSeconds: 10
livenessProbe:
httpGet:
path: /healthz
port: 9440
initialDelaySeconds: 3
periodSeconds: 3
6 changes: 6 additions & 0 deletions config/render/capm3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -870,4 +870,10 @@ spec:
requests:
cpu: 100m
memory: 20Mi
livenessProbe:
httpGet:
path: /healthz
port: 9440
initialDelaySeconds: 3
periodSeconds: 3
terminationGracePeriodSeconds: 10
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ func main() {
var devLogging bool
var runInTestMode bool
var runInDemoMode bool
var healthAddr string

// From CAPI point of view, BMO should be able to watch all namespaces
// in case of a deployment that is not multi-tenant. If the deployment
Expand All @@ -79,6 +80,8 @@ func main() {
flag.BoolVar(&runInTestMode, "test-mode", false, "disable ironic communication")
flag.BoolVar(&runInDemoMode, "demo-mode", false,
"use the demo provisioner to set host states")
flag.StringVar(&healthAddr, "health-addr", ":9440",
"The address the health endpoint binds to.")
flag.Parse()

ctrl.SetLogger(zap.New(zap.UseDevMode(devLogging)))
Expand All @@ -93,6 +96,7 @@ func main() {
LeaderElectionID: "baremetal-operator",
LeaderElectionNamespace: watchNamespace,
Namespace: watchNamespace,
HealthProbeBindAddress: healthAddr,
})
if err != nil {
setupLog.Error(err, "unable to start manager")
Expand Down

0 comments on commit 28a0c53

Please sign in to comment.