Documentation ¶
Index ¶
- Constants
- func LoadConfig(kubeConfigPath string) (*rest.Config, error)
- type ContainerEventHandler
- type Metadata
- func (k *Metadata) AddContainerEventHandler(eh ContainerEventHandler)
- func (k *Metadata) AddPodEventHandler(h cache.ResourceEventHandler) error
- func (k *Metadata) AddReplicaSetEventHandler(h cache.ResourceEventHandler) error
- func (k *Metadata) FetchPodOwnerInfo(pod *PodInfo)
- func (k *Metadata) GetContainerPod(containerID string) (*PodInfo, bool)
- func (k *Metadata) GetReplicaSetInfo(namespace, name string) (*ReplicaSetInfo, bool)
- func (k *Metadata) InitFromClient(client kubernetes.Interface, timeout time.Duration) error
- type PodInfo
- type ReplicaSetInfo
Constants ¶
const ( IndexPodByContainerIDs = "idx_pod_by_container" IndexReplicaSetNames = "idx_rs" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ContainerEventHandler ¶
type ContainerEventHandler interface {
OnDeletion(containerID []string)
}
ContainerEventHandler listens for the deletion of containers, as triggered by a Pod deletion.
type Metadata ¶
type Metadata struct {
// contains filtered or unexported fields
}
Metadata stores an in-memory copy of the different Kubernetes objects whose metadata is relevant to us.
func (*Metadata) AddContainerEventHandler ¶
func (k *Metadata) AddContainerEventHandler(eh ContainerEventHandler)
func (*Metadata) AddPodEventHandler ¶
func (k *Metadata) AddPodEventHandler(h cache.ResourceEventHandler) error
func (*Metadata) AddReplicaSetEventHandler ¶
func (k *Metadata) AddReplicaSetEventHandler(h cache.ResourceEventHandler) error
func (*Metadata) FetchPodOwnerInfo ¶
FetchPodOwnerInfo updates the passed pod with the owner Desployment info, if required and if it exists.
func (*Metadata) GetContainerPod ¶
GetContainerPod fetches metadata from a Pod given the name of one of its containera
func (*Metadata) GetReplicaSetInfo ¶
func (k *Metadata) GetReplicaSetInfo(namespace, name string) (*ReplicaSetInfo, bool)
GetReplicaSetInfo fetches metadata from a ReplicaSet given its name
func (*Metadata) InitFromClient ¶
type PodInfo ¶
type PodInfo struct { // Informers need that internal object is an ObjectMeta instance metav1.ObjectMeta NodeName string ReplicaSetName string // Pod Info includes the ReplicaSet as owner reference, and ReplicaSet info // has Deployment as owner reference. We initially do a two-steps lookup to // get the Pod's Deployment, but then cache the Deployment value here DeploymentName string // StartTimeStr caches value of ObjectMeta.StartTimestamp.String() StartTimeStr string ContainerIDs []string }
PodInfo contains precollected metadata for Pods, Nodes and Services. Not all the fields are populated for all the above types. To save memory, we just keep in memory the necessary data for each Type. For more information about which fields are set for each type, please refer to the instantiation function of the respective informers.
type ReplicaSetInfo ¶
type ReplicaSetInfo struct { metav1.ObjectMeta DeploymentName string }