Skip to content

Commit eb13154

Browse files
authored
Add health probe endpoint flag/configuration (#137)
Part of aws-controllers-k8s/community#2012 This patch adds a new flag to all the controllers, allowing users and operators to setup a healthz endpoint. Very rarely those flags (Healthz and Metrics) and modified by users, so we're assigning them distinct ports (8080 and 8081). Signed-off-by: Amine Hilaly <[email protected]> By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 7b2f70d commit eb13154

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pkg/config/config.go

+7
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ const (
4242
flagEnableLeaderElection = "enable-leader-election"
4343
flagLeaderElectionNamespace = "leader-election-namespace"
4444
flagMetricAddr = "metrics-addr"
45+
flagHealthzAddr = "healthz-addr"
4546
flagEnableDevLogging = "enable-development-logging"
4647
flagAWSRegion = "aws-region"
4748
flagAWSEndpointURL = "aws-endpoint-url"
@@ -74,6 +75,7 @@ var (
7475
// Config contains configuration options for ACK service controllers
7576
type Config struct {
7677
MetricsAddr string
78+
HealthzAddr string
7779
EnableLeaderElection bool
7880
LeaderElectionNamespace string
7981
EnableDevelopmentLogging bool
@@ -99,6 +101,11 @@ func (cfg *Config) BindFlags() {
99101
"0.0.0.0:8080",
100102
"The address the metric endpoint binds to.",
101103
)
104+
flag.StringVar(
105+
&cfg.HealthzAddr, flagHealthzAddr,
106+
"0.0.0.0:8081",
107+
"The address the health probe endpoint binds to.",
108+
)
102109
flag.BoolVar(
103110
&cfg.EnableWebhookServer, flagEnableWebhookServer,
104111
false,

0 commit comments

Comments
 (0)