Documentation
¶
Overview ¶
Package k8s implements a client for communicating with a Kubernetes apiserver. It is intended to support an ingress controller, so it is limited to the types needed.
The types are copied from the stable api of the Kubernetes 1.3 release.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // GetIngresses returns all the ingresses in the cluster. GetIngresses() ([]*v1beta1.Ingress, error) // GetServices returns all the services in the cluster. GetServices() ([]*v1.Service, error) // WatchIngresses watches for updates to ingresses and notifies the Watcher. WatchIngresses() Watcher // WatchServices watches for updates to services and notifies the Watcher. WatchServices() Watcher // UpdateIngressStatus updates the ingress status with the loadbalancer hostname or ip address. UpdateIngressStatus(*v1beta1.Ingress) error }
Client for connecting to a Kubernetes cluster. Watchers will receive a notification whenever the client connects to the API server, including reconnects, to notify that there may be new ingresses that need to be retrieved. It's intended that client code will call the getters to retrieve the current state when notified.
type Watcher ¶
type Watcher interface {
// Updates provides update notification.
Updates() <-chan interface{}
}
Watcher provides channels for receiving updates. It tries its best to run forever, retrying if the underlying connection fails.
func CombineWatchers ¶
CombineWatchers returns a watcher that watches all. The combined watcher becomes the owner of the passed in watchers and so clients should not attempt to use or stop the individual watchers.