Documentation ¶
Index ¶
- Variables
- func NewGetHealthzHandler(s *Server) GetHealthzHandler
- func NewGetHelloHandler(s *Server) GetHelloHandler
- func NewGetStatusHandler(s *Server) GetStatusHandler
- func NewHealthNode(elem *models.NodeElement) healthNode
- func NewPutStatusProbeHandler(s *Server) PutStatusProbeHandler
- type AdminOption
- type Config
- type Server
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", } // AdminOptions is the slice of all valid AdminOption values. AdminOptions = []AdminOption{ AdminOptionAny, AdminOptionUnix, } )
Functions ¶
func NewGetHealthzHandler ¶
func NewGetHealthzHandler(s *Server) GetHealthzHandler
NewGetHealthzHandler handles health requests.
func NewGetHelloHandler ¶
func NewGetHelloHandler(s *Server) GetHelloHandler
NewGetHelloHandler handles hello 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 AdminOption ¶
type AdminOption string
AdminOption is an option for determining over which protocols the APIs are exposed.
const ( // AdminOptionAny exposes every API over both Unix and HTTP sockets. AdminOptionAny AdminOption = "any" // AdminOptionUnix restricts most APIs to hosting over Unix sockets. AdminOptionUnix AdminOption = "unix" )
type Config ¶
type Config struct { Debug bool Passive bool Admin AdminOption 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
Also, if "Passive" is not set in s.Config:
- 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().