Documentation ¶
Index ¶
- func GetNamespaceServiceAccountAnnotation(ns *v1.Namespace, namespaceKey string) []string
- func NamespaceIndexFunc(obj interface{}) ([]string, error)
- func PodIPIndexFunc(obj interface{}) ([]string, error)
- type Client
- func (k8s *Client) ListNamespaces() []string
- func (k8s *Client) ListPodIPs() []string
- func (k8s *Client) NamespaceByName(namespaceName string) (*v1.Namespace, error)
- func (k8s *Client) PodByIP(IP string) (*v1.Pod, error)
- func (k8s *Client) WatchForNamespaces(nsEventLogger cache.ResourceEventHandler) cache.InformerSynced
- func (k8s *Client) WatchForPods(podEventLogger cache.ResourceEventHandler) cache.InformerSynced
- type NamespaceHandler
- type PodHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetNamespaceServiceAccountAnnotation ¶
GetNamespaceServiceAccountAnnotation reads the "iam.amazonaws.com/allowed-serviceAccounts" annotation off a namespace and splits them as a JSON list (["serviceAccount1", "serviceAccount2", "serviceAccount3"])
func NamespaceIndexFunc ¶
NamespaceIndexFunc maps a namespace to it's name.
func PodIPIndexFunc ¶
PodIPIndexFunc maps a given Pod to it's IP for caching.
Types ¶
type Client ¶
type Client struct { *kubernetes.Clientset // contains filtered or unexported fields }
Client represents a kubernetes client.
func (*Client) ListNamespaces ¶
ListNamespaces returns the underlying set of namespaces being managed/indexed
func (*Client) ListPodIPs ¶
ListPodIPs returns the underlying set of pods being managed/indexed
func (*Client) NamespaceByName ¶
NamespaceByName retrieves a namespace by it's given name. Returns an error if there are no namespaces available
func (*Client) PodByIP ¶
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.
type NamespaceHandler ¶
type NamespaceHandler struct {
// contains filtered or unexported fields
}
NamespaceHandler outputs change events from K8.
func NewNamespaceHandler ¶
func NewNamespaceHandler(namespaceKey string) *NamespaceHandler
NewNamespaceHandler returns a new namespace handler.
func (*NamespaceHandler) OnAdd ¶
func (h *NamespaceHandler) OnAdd(obj interface{})
OnAdd called with a namespace is added to k8s.
func (*NamespaceHandler) OnDelete ¶
func (h *NamespaceHandler) OnDelete(obj interface{})
OnDelete called with a namespace is removed from k8s.
func (*NamespaceHandler) OnUpdate ¶
func (h *NamespaceHandler) OnUpdate(oldObj, newObj interface{})
OnUpdate called with a namespace is updated inside k8s.
type PodHandler ¶
type PodHandler struct {
// contains filtered or unexported fields
}
PodHandler represents a pod handler.
func NewPodHandler ¶
func NewPodHandler(iamServiceAccountKey string) *PodHandler
NewPodHandler constructs a pod handler given the relevant IAM ServiceAccount Key
func (*PodHandler) OnAdd ¶
func (p *PodHandler) OnAdd(obj interface{})
OnAdd is called when a pod is added.
func (*PodHandler) OnDelete ¶
func (p *PodHandler) OnDelete(obj interface{})
OnDelete is called when a pod is deleted.
func (*PodHandler) OnUpdate ¶
func (p *PodHandler) OnUpdate(oldObj, newObj interface{})
OnUpdate is called when a pod is modified.