MCPcopy
hub / github.com/istio/istio / initIstiodAdminServer

Method initIstiodAdminServer

pilot/pkg/bootstrap/server.go:673–693  ·  view source on GitHub ↗

initIstiodAdminServer initializes monitoring, debug and readiness end points.

(args *PilotArgs, whc func() map[string]string)

Source from the content-addressed store, hash-verified

671
672// initIstiodAdminServer initializes monitoring, debug and readiness end points.
673func (s *Server) initIstiodAdminServer(args *PilotArgs, whc func() map[string]string) error {
674 // Debug Server.
675 internalMux := s.XDSServer.InitDebug(s.monitoringMux, args.ServerOptions.EnableProfiling, whc)
676 s.internalDebugMux = internalMux
677
678 // Debug handlers are currently added on monitoring mux and readiness mux.
679 // If monitoring addr is empty, the mux is shared and we only add it once on the shared mux .
680 if args.ServerOptions.MonitoringAddr != "" {
681 s.XDSServer.AddDebugHandlers(s.httpMux, nil, args.ServerOptions.EnableProfiling, whc)
682 }
683
684 // Monitoring Server.
685 if err := s.initMonitor(args.ServerOptions.MonitoringAddr); err != nil {
686 return fmt.Errorf("error initializing monitor: %v", err)
687 }
688
689 // Readiness Handler.
690 s.httpMux.HandleFunc("/ready", s.istiodReadyHandler)
691
692 return nil
693}
694
695// initDiscoveryService initializes discovery server on plain text port.
696func (s *Server) initDiscoveryService() {

Callers 1

NewServerFunction · 0.95

Calls 4

initMonitorMethod · 0.95
InitDebugMethod · 0.80
AddDebugHandlersMethod · 0.80
ErrorfMethod · 0.65

Tested by

no test coverage detected