slaventius 2 years ago
parent 0ef55b6a4f
commit 28434a9fa7
  1. 4
      deploy/auth-deployment.yaml
  2. 6
      internal/auth.go

@ -25,9 +25,9 @@ spec:
name: auth-config name: auth-config
readinessProbe: readinessProbe:
httpGet: httpGet:
path: /api/v1/ready path: /api/v1/health
port: 9994 port: 9994
periodSeconds: 1 periodSeconds: 1
initialDelaySeconds: 3 initialDelaySeconds: 3
failureThreshold: 1 failureThreshold: 2
successThreshold: 1 successThreshold: 1

@ -32,8 +32,7 @@ func NewServer(ctx context.Context, config *config.Config) *AuthServer {
} }
// //
s.Router.Get("/api/v1/live", live(s)) s.Router.Get("/api/v1/health", health(s))
s.Router.Get("/api/v1/ready", live(s))
// //
s.Router.Post("/api/v1/login", login(s)) s.Router.Post("/api/v1/login", login(s))
@ -47,8 +46,9 @@ func (s *AuthServer) GracefulStop() error {
return s.db.Close() return s.db.Close()
} }
func live(s *AuthServer) http.HandlerFunc { func health(s *AuthServer) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) { return func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(200)
w.Write([]byte("ok")) w.Write([]byte("ok"))
} }
} }

Loading…
Cancel
Save