VOL-1739 Create Kubernetes Probes for Simulated ONU Adapter
Change-Id: I481d29df47a1ed7ede60cd3f8840221aef861e6b
diff --git a/internal/pkg/config/config.go b/internal/pkg/config/config.go
index 2971169..d87b0d9 100644
--- a/internal/pkg/config/config.go
+++ b/internal/pkg/config/config.go
@@ -38,6 +38,8 @@
default_Banner = false
default_Topic = "simulated_onu"
default_CoreTopic = "rwcore"
+ default_ProbeHost = ""
+ default_ProbePort = 8080
)
// AdapterFlags represents the set of configurations used by the read-write adaptercore service
@@ -56,6 +58,8 @@
CoreTopic string
LogLevel int
Banner bool
+ ProbeHost string
+ ProbePort int
}
func init() {
@@ -78,6 +82,8 @@
CoreTopic: default_CoreTopic,
LogLevel: default_LogLevel,
Banner: default_Banner,
+ ProbeHost: default_ProbeHost,
+ ProbePort: default_ProbePort,
}
return &adapterFlags
}
@@ -123,6 +129,12 @@
help = fmt.Sprintf("Show startup banner log lines")
flag.BoolVar(&so.Banner, "banner", default_Banner, help)
+ help = fmt.Sprintf("The address on which to listen to answer liveness and readiness probe queries over HTTP.")
+ flag.StringVar(&(so.ProbeHost), "probe_host", default_ProbeHost, help)
+
+ help = fmt.Sprintf("The port on which to listen to answer liveness and readiness probe queries over HTTP.")
+ flag.IntVar(&(so.ProbePort), "probe_port", default_ProbePort, help)
+
flag.Parse()
containerName := getContainerInfo()