kubernetes

package
v0.0.0-...-d3eceb9 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2017 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateResourceController

func CreateResourceController(client cache.Getter, resource string, namespace string, apiStruct runtime.Object, selector fields.Selector,
	addFunc func(addedApiStruct interface{}), deleteFunc func(deletedApiStruct interface{}), updateFunc func(oldApiStruct, updatedApiStruct interface{})) (cache.Store, cache.Controller)

CreateResourceController creates a controller for a specific ressource and namespace. The parameter function will be called on Add/Delete/Update events

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is the Trireme representation of the Client.

func NewClient

func NewClient(kubeconfig string, nodename string) (*Client, error)

NewClient Generate and initialize a Trireme Client object

func (*Client) AddLocalNodeAnnotation

func (c *Client) AddLocalNodeAnnotation(annotationKey, annotationValue string) error

AddLocalNodeAnnotation adds the annotationKey:annotationValue

func (*Client) AllNamespaces

func (c *Client) AllNamespaces() (*api.NamespaceList, error)

AllNamespaces return a list of all existing namespaces

func (*Client) AllNodes

func (c *Client) AllNodes() (*api.NodeList, error)

AllNodes return a list of all the nodes on the KubeCluster.

func (*Client) CreateLocalPodController

func (c *Client) CreateLocalPodController(namespace string,
	addFunc func(addedApiStruct *api.Pod) error, deleteFunc func(deletedApiStruct *api.Pod) error, updateFunc func(oldApiStruct, updatedApiStruct *api.Pod) error) (cache.Store, cache.Controller)

CreateLocalPodController creates a controller specifically for Pods.

func (*Client) CreateNamespaceController

func (c *Client) CreateNamespaceController(
	addFunc func(addedApiStruct *api.Namespace) error, deleteFunc func(deletedApiStruct *api.Namespace) error, updateFunc func(oldApiStruct, updatedApiStruct *api.Namespace) error) (cache.Store, cache.Controller)

CreateNamespaceController creates a controller specifically for Namespaces.

func (*Client) CreateNetworkPoliciesController

func (c *Client) CreateNetworkPoliciesController(namespace string,
	addFunc func(addedApiStruct *extensions.NetworkPolicy) error, deleteFunc func(deletedApiStruct *extensions.NetworkPolicy) error, updateFunc func(oldApiStruct, updatedApiStruct *extensions.NetworkPolicy) error) (cache.Store, cache.Controller)

CreateNetworkPoliciesController creates a controller specifically for NetworkPolicies.

func (*Client) CreateNodeController

func (c *Client) CreateNodeController(
	addFunc func(addedApiStruct *api.Node) error, deleteFunc func(deletedApiStruct *api.Node) error, updateFunc func(oldApiStruct, updatedApiStruct *api.Node) error) (cache.Store, cache.Controller)

CreateNodeController creates a controller specifically for Nodes.

func (*Client) CreateServiceController

func (c *Client) CreateServiceController(namespace string,
	addFunc func(addedApiStruct *api.Service) error, deleteFunc func(deletedApiStruct *api.Service) error, updateFunc func(oldApiStruct, updatedApiStruct *api.Service) error) (cache.Store, cache.Controller)

CreateServiceController creates a controller specifically for Services.

func (*Client) Endpoints

func (c *Client) Endpoints(service string, namespace string) (*api.Endpoints, error)

Endpoints return the list of all the Endpoints that are serviced by a specific service/namespace.

func (*Client) InitKubernetesClient

func (c *Client) InitKubernetesClient(kubeconfig string) error

InitKubernetesClient Initialize the Kubernetes client based on the parameter kubeconfig if Kubeconfig is empty, try an in-cluster auth.

func (*Client) KubeClient

func (c *Client) KubeClient() kubernetes.Interface

KubeClient returns the Kubernetes ClientSet

func (*Client) LocalPods

func (c *Client) LocalPods(namespace string) (*api.PodList, error)

LocalPods return a PodList with all the pods scheduled on the local node

func (*Client) Pod

func (c *Client) Pod(podName string, namespace string) (*api.Pod, error)

Pod returns the full pod object.

func (*Client) PodIP

func (c *Client) PodIP(podName string, namespace string) (string, error)

PodIP returns the pod's IP.

func (*Client) PodLabels

func (c *Client) PodLabels(podName string, namespace string) (map[string]string, error)

PodLabels returns the list of all labels associated with a pod.

func (*Client) PodLabelsAndIP

func (c *Client) PodLabelsAndIP(podName string, namespace string) (map[string]string, string, error)

PodLabelsAndIP returns the list of all labels associated with a pod as well as the Pod's IP.

func (*Client) PodRules

func (c *Client) PodRules(podName string, namespace string, allPolicies *extensions.NetworkPolicyList) (*[]extensions.NetworkPolicyIngressRule, error)

PodRules return the list of all the IngressRules that apply to the pod.

Jump to

Keyboard shortcuts

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