k8s

package
v0.0.0-...-b3ac2b6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2020 License: BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*kubernetes.Clientset
	// contains filtered or unexported fields
}

Client represents a kubernetes client.

func NewClient

func NewClient(host, token, nodeName string, insecure bool) (*Client, error)

NewClient returns a new kubernetes client.

func (*Client) ListNamespaces

func (k8s *Client) ListNamespaces() []string

ListNamespaces returns the underlying set of namespaces being managed/indexed

func (*Client) ListPodIPs

func (k8s *Client) ListPodIPs() []string

ListPodIPs returns the underlying set of pods being managed/indexed

func (*Client) NamespaceByName

func (k8s *Client) NamespaceByName(namespaceName string) (*v1.Namespace, error)

NamespaceByName retrieves a namespace by it's given name. Returns an error if there are no namespaces available

func (*Client) PodByIP

func (k8s *Client) PodByIP(IP string) (*v1.Pod, error)

PodByIP provides the representation of the pod itself being cached keyed off of it's IP Returns an error if there are multiple pods attempting to be keyed off of the same IP (Which happens when they of type `hostNetwork: true`)

func (*Client) WatchForNamespaces

func (k8s *Client) WatchForNamespaces(nsEventLogger cache.ResourceEventHandler) cache.InformerSynced

WatchForNamespaces watches for namespaces changes.

func (*Client) WatchForPods

func (k8s *Client) WatchForPods(podEventLogger cache.ResourceEventHandler) cache.InformerSynced

WatchForPods watches for pod changes.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL