initIstiodAdminServer initializes monitoring, debug and readiness end points.
(args *PilotArgs, whc func() map[string]string)
| 671 | |
| 672 | // initIstiodAdminServer initializes monitoring, debug and readiness end points. |
| 673 | func (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. |
| 696 | func (s *Server) initDiscoveryService() { |
no test coverage detected