Documentation ¶
Index ¶
- func NewClientSet(kubeConfig string) (*kubernetes.Clientset, error)
- type EndpointsListener
- type EndpointsWatcher
- type InMemoryPodIndex
- type Lister
- type MockEndpointsWatcher
- func (m *MockEndpointsWatcher) GetService(service string) (*v1.Service, bool, error)
- func (m *MockEndpointsWatcher) Run() error
- func (m *MockEndpointsWatcher) Stop()
- func (m *MockEndpointsWatcher) Subscribe(service string, port uint32, listener EndpointsListener) error
- func (m *MockEndpointsWatcher) Unsubscribe(service string, port uint32, listener EndpointsListener) error
- type PodIndex
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClientSet ¶
func NewClientSet(kubeConfig string) (*kubernetes.Clientset, error)
Types ¶
type EndpointsListener ¶
type EndpointsListener interface { Update(add []common.TcpAddress, remove []common.TcpAddress) NoEndpoints(exists bool) }
type EndpointsWatcher ¶
type EndpointsWatcher interface { GetService(service string) (*v1.Service, bool, error) Subscribe(service string, port uint32, listener EndpointsListener) error Unsubscribe(service string, port uint32, listener EndpointsListener) error Run() error Stop() }
func NewEndpointsWatcher ¶
func NewEndpointsWatcher(clientset *kubernetes.Clientset) EndpointsWatcher
An EndpointsWatcher watches all endpoints and services in the Kubernetes cluster. Listeners can subscribe to a particular service and port and EndpointsWatcher will publish the address set and all future changes for that service:port.
type InMemoryPodIndex ¶ added in v0.4.0
func (*InMemoryPodIndex) GetPod ¶ added in v0.4.0
func (i *InMemoryPodIndex) GetPod(key string) (*v1.Pod, error)
func (*InMemoryPodIndex) GetPodsByIndex ¶ added in v0.4.0
func (i *InMemoryPodIndex) GetPodsByIndex(key string) ([]*v1.Pod, error)
func (*InMemoryPodIndex) List ¶ added in v0.4.0
func (i *InMemoryPodIndex) List() ([]*v1.Pod, error)
func (*InMemoryPodIndex) Run ¶ added in v0.4.0
func (i *InMemoryPodIndex) Run() error
func (*InMemoryPodIndex) Stop ¶ added in v0.4.0
func (i *InMemoryPodIndex) Stop()
type Lister ¶ added in v0.4.1
type Lister struct { NS corelisters.NamespaceLister Deploy applisters.DeploymentLister RS applisters.ReplicaSetLister Pod corelisters.PodLister RC corelisters.ReplicationControllerLister Svc corelisters.ServiceLister // contains filtered or unexported fields }
Lister wraps client-go Lister types for all Kubernetes objects
func NewLister ¶ added in v0.4.1
func NewLister(k8sClient kubernetes.Interface) *Lister
NewLister takes a Kubernetes client and returns an initialized Lister
func (*Lister) GetObjects ¶ added in v0.4.1
GetObjects returns a list of Kubernetes objects, given a namespace, type, and name. If namespace is an empty string, match objects in all namespaces. If name is an empty string, match all objects of the given type.
func (*Lister) GetPodsFor ¶ added in v0.4.1
GetPodsFor returns all running and pending Pods associated with a given Kubernetes object.
type MockEndpointsWatcher ¶ added in v0.4.0
type MockEndpointsWatcher struct { HostReceived string ListenerSubscribed EndpointsListener ListenerUnsubscribed EndpointsListener ServiceToReturn *v1.Service ExistsToReturn bool ErrToReturn error }
func (*MockEndpointsWatcher) GetService ¶ added in v0.4.0
func (*MockEndpointsWatcher) Run ¶ added in v0.4.0
func (m *MockEndpointsWatcher) Run() error
func (*MockEndpointsWatcher) Stop ¶ added in v0.4.0
func (m *MockEndpointsWatcher) Stop()
func (*MockEndpointsWatcher) Subscribe ¶ added in v0.4.0
func (m *MockEndpointsWatcher) Subscribe(service string, port uint32, listener EndpointsListener) error
func (*MockEndpointsWatcher) Unsubscribe ¶ added in v0.4.0
func (m *MockEndpointsWatcher) Unsubscribe(service string, port uint32, listener EndpointsListener) error
type PodIndex ¶
type PodIndex interface { GetPod(key string) (*v1.Pod, error) GetPodsByIndex(key string) ([]*v1.Pod, error) List() ([]*v1.Pod, error) Run() error Stop() }
func NewEmptyPodIndex ¶ added in v0.4.0
func NewEmptyPodIndex() PodIndex
func NewPodIndex ¶
func NewPodsByIp ¶ added in v0.4.0
func NewPodsByIp(clientSet *kubernetes.Clientset) (PodIndex, error)
NewPodsByIp returns a PodIndex with the Pod's IP as its key.