diff --git a/cmd/inbound/inbound.go b/cmd/inbound/inbound.go index 1d69574..e10a693 100644 --- a/cmd/inbound/inbound.go +++ b/cmd/inbound/inbound.go @@ -5,6 +5,8 @@ import ( "crypto/tls" "encoding/json" "flag" + "fmt" + "net/http" "os" "os/signal" "syscall" @@ -93,5 +95,15 @@ func main() { GetCertificate: cm.Get, } + go runHealthService() + log.Fatal("server exited", zap.Error(s.ListenAndServeTLS())) } + +func runHealthService() { + http.HandleFunc("/health", func(w http.ResponseWriter, req *http.Request) { + w.Write([]byte("OK")) //nolint:errcheck + }) + + http.ListenAndServe(fmt.Sprintf(":%d", healthPort), nil) //nolint:errcheck +}