Documentation ¶
Index ¶
- func CreateResourceController(client cache.Getter, resource string, namespace string, ...) (cache.Store, cache.Controller)
- type Client
- func (c *Client) AddLocalNodeAnnotation(annotationKey, annotationValue string) error
- func (c *Client) AllNamespaces() (*api.NamespaceList, error)
- func (c *Client) AllNodes() (*api.NodeList, error)
- func (c *Client) CreateLocalPodController(namespace string, addFunc func(addedApiStruct *api.Pod) error, ...) (cache.Store, cache.Controller)
- func (c *Client) CreateNamespaceController(addFunc func(addedApiStruct *api.Namespace) error, ...) (cache.Store, cache.Controller)
- func (c *Client) CreateNetworkPoliciesController(namespace string, addFunc func(addedApiStruct *extensions.NetworkPolicy) error, ...) (cache.Store, cache.Controller)
- func (c *Client) CreateNodeController(addFunc func(addedApiStruct *api.Node) error, ...) (cache.Store, cache.Controller)
- func (c *Client) CreateServiceController(namespace string, addFunc func(addedApiStruct *api.Service) error, ...) (cache.Store, cache.Controller)
- func (c *Client) Endpoints(service string, namespace string) (*api.Endpoints, error)
- func (c *Client) InitKubernetesClient(kubeconfig string) error
- func (c *Client) KubeClient() kubernetes.Interface
- func (c *Client) LocalPods(namespace string) (*api.PodList, error)
- func (c *Client) Pod(podName string, namespace string) (*api.Pod, error)
- func (c *Client) PodIP(podName string, namespace string) (string, error)
- func (c *Client) PodLabels(podName string, namespace string) (map[string]string, error)
- func (c *Client) PodLabelsAndIP(podName string, namespace string) (map[string]string, string, error)
- func (c *Client) PodRules(podName string, namespace string, allPolicies *extensions.NetworkPolicyList) (*[]extensions.NetworkPolicyIngressRule, error)
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 (*Client) AddLocalNodeAnnotation ¶
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) 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 ¶
Endpoints return the list of all the Endpoints that are serviced by a specific service/namespace.
func (*Client) InitKubernetesClient ¶
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) 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.