Documentation
¶
Overview ¶
Package probe is the readiness probe of a device pod. It is a tiny static program, copied by an init container into an emptyDir that the device container mounts read-only, because a device image may carry no shell and no curl. The kubelet runs it as an exec readiness probe inside the container, so it sees the container's own network namespace and file system.
Index ¶
Constants ¶
const ( SchemeTCP = "tcp" SchemeHTTP = "http" SchemeHTTPS = "https" // InstalledName is the file name of the copy in the shared directory. InstalledName = "probe" )
Variables ¶
This section is empty.
Functions ¶
func Install ¶
Install copies the program src to dir/InstalledName, read-only and executable by everybody, so the device container can run it as any user and cannot change it. The copy is atomic: a rerun of the init container never leaves half a file.
func LocalAddrs ¶
func LocalAddrs() []string
LocalAddrs are the addresses the probe tries: the loopback first, then every global unicast address of the container (an application may listen only on the pod's own address).
Types ¶
type Check ¶
type Check struct {
// File is a marker the application creates; the check passes once it exists.
File string
// Port is a port the application must answer on, with Scheme tcp (a connection is accepted), http or https (an HTTP
// answer with a status below 500: any answer proves the application serves; 4xx is a page behind a login, not a
// failure).
Port int
Scheme string
}
Check is what makes a device ready. Every set part must pass; an empty Check is an error, not success.