Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Client ¶
func Client(token, apiURL, caURL string) (*kubernetes.Clientset, error)
Client returns a Kubernetes client (clientset) from token, apiURL and caURL
func ClientFromConfig ¶
func ClientFromConfig(path string) (*kubernetes.Clientset, error)
ClientFromConfig returns a Kubernetes client (clientset) from the kubeconfig path or from the in-cluster service account environment.
Types ¶
type PodEventHandler ¶
PodEventHandler is the function to handle new events
type PodWatcher ¶
type PodWatcher struct { ListHealthy bool WatchHealthy bool // contains filtered or unexported fields }
PodWatcher has a watch on the clients pods
func NewPodWatcher ¶
func NewPodWatcher(client kubernetes.Interface, resyncPeriod time.Duration, handler PodEventHandler, labelSelector string) *PodWatcher
NewPodWatcher returns a new pod wathcer.
func (*PodWatcher) HasSynced ¶
func (pw *PodWatcher) HasSynced() bool
HasSynced calls controllers HasSync method to determine whether the watcher cache is synced.
func (*PodWatcher) Healthy ¶
func (pw *PodWatcher) Healthy() bool
Healthy is true when both list and watch handlers are running without errors.
func (*PodWatcher) Init ¶
func (pw *PodWatcher) Init()
Init sets up the list, watch functions and the cache.
func (*PodWatcher) List ¶
func (pw *PodWatcher) List() ([]*v1.Pod, error)
List lists all pods from the store
func (*PodWatcher) Run ¶
func (pw *PodWatcher) Run()
Run will not return unless writting in the stop channel
func (*PodWatcher) Stop ¶
func (pw *PodWatcher) Stop()
Stop stop the watcher via the respective channel