Add operator deployment readiness probe (#1874)

* Add operator deployment readiness probe
This commit is contained in:
Dmitry Volodin
2023-01-05 18:29:47 +01:00
committed by GitHub
parent 29cec0ceda
commit 625e804dc4
3 changed files with 18 additions and 1 deletions
+5 -1
View File
@@ -12,7 +12,6 @@ import (
"time"
"github.com/sirupsen/logrus"
"github.com/zalando/postgres-operator/pkg/cluster"
"github.com/zalando/postgres-operator/pkg/spec"
"github.com/zalando/postgres-operator/pkg/util"
@@ -87,6 +86,7 @@ func New(controller controllerInformer, port int, logger *logrus.Logger) *Server
mux.Handle("/debug/pprof/trace", http.HandlerFunc(pprof.Trace))
mux.Handle("/status/", http.HandlerFunc(s.controllerStatus))
mux.Handle("/readyz/", http.HandlerFunc(s.controllerReady))
mux.Handle("/config/", http.HandlerFunc(s.operatorConfig))
mux.HandleFunc("/clusters/", s.clusters)
@@ -155,6 +155,10 @@ func (s *Server) controllerStatus(w http.ResponseWriter, req *http.Request) {
s.respond(s.controller.GetStatus(), nil, w)
}
func (s *Server) controllerReady(w http.ResponseWriter, req *http.Request) {
s.respond("OK", nil, w)
}
func (s *Server) operatorConfig(w http.ResponseWriter, req *http.Request) {
s.respond(map[string]interface{}{
"controller": s.controller.GetConfig(),