Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // PortToPaths is a convenience map for access to the ports and their // common string representations PortToPaths = map[int]string{ defaults.HTTPPathPort: "Via L3", } )
Functions ¶
func NewGetHealthzHandler ¶
func NewGetHealthzHandler(s *Server) GetHealthzHandler
NewGetHealthzHandler handles health requests.
func NewGetStatusHandler ¶
func NewGetStatusHandler(s *Server) GetStatusHandler
NewGetStatusHandler handles requests for cached connectivity status.
func NewHealthNode ¶
func NewHealthNode(elem *models.NodeElement) healthNode
NewHealthNode creates a new node structure based on the specified model.
func NewPutStatusProbeHandler ¶
func NewPutStatusProbeHandler(s *Server) PutStatusProbeHandler
NewPutStatusProbeHandler handles requests for connectivity probes.
Types ¶
type Config ¶
type Config struct { Debug bool CiliumURI string ProbeInterval time.Duration ProbeDeadline time.Duration }
Config stores the configuration data for a cilium-health server.
type Server ¶
type Server struct { healthApi.Server // Server to provide cilium-health API *ciliumPkg.Client // Client to "GET /healthz" on cilium daemon Config // The lock protects against read and write access to the IP->Node map, // the list of statuses as most recently seen, and the last time a // probe was conducted. lock.RWMutex // contains filtered or unexported fields }
Server is the cilium-health daemon that is in charge of performing health and connectivity checks periodically, and serving the cilium-health API.
func (*Server) DumpUptime ¶
DumpUptime returns the time that this server has been running.
func (*Server) FetchStatusResponse ¶
func (s *Server) FetchStatusResponse() (*healthModels.HealthStatusResponse, error)
FetchStatusResponse updates the cluster with the latest set of nodes, runs a synchronous probe across the cluster, updates the connectivity cache and returns the results.
func (*Server) GetStatusResponse ¶
func (s *Server) GetStatusResponse() *healthModels.HealthStatusResponse
GetStatusResponse returns the most recent cluster connectivity status.
func (*Server) Serve ¶
Serve spins up the following goroutines:
- TCP API Server: Responders to the health API "/hello" message, one per path
- Prober: Periodically run pings across the cluster at a configured interval and update the server's connectivity status cache.
- Unix API Server: Handle all health API requests over a unix socket.
Callers should first defer the Server.Shutdown(), then call Serve().