Documentation ¶
Index ¶
- type ContextKey
- type KubeletPodFetcher
- type PodFetcher
- type PodFetcherStub
- func (p *PodFetcherStub) GetContainerID(podUID, containerName string) (string, error)
- func (p *PodFetcherStub) GetContainerSpec(podUID, containerName string) (*v1.Container, error)
- func (p *PodFetcherStub) GetPod(_ context.Context, podUID string) (*v1.Pod, error)
- func (p *PodFetcherStub) GetPodList(_ context.Context, podFilter func(*v1.Pod) bool) ([]*v1.Pod, error)
- func (p *PodFetcherStub) Run(_ context.Context)
- type RuntimePod
- type RuntimePodFetcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContextKey ¶ added in v0.2.0
type ContextKey string
const ( BypassCacheKey ContextKey = "bypass_cache" BypassCacheTrue ContextKey = "true" )
type KubeletPodFetcher ¶
type KubeletPodFetcher interface { // GetPodList returns those latest pods, and podFilter is a function to filter a pod, // if pod passed return true else return false, if podFilter is nil return all pods GetPodList(ctx context.Context, podFilter func(*v1.Pod) bool) ([]*v1.Pod, error) }
KubeletPodFetcher is used to get K8S kubelet pod information.
func NewKubeletPodFetcher ¶
func NewKubeletPodFetcher() KubeletPodFetcher
type PodFetcher ¶
type PodFetcher interface { KubeletPodFetcher // Run starts the preparing logic to collect pod metadata. Run(ctx context.Context) // GetContainerID & GetContainerSpec are used to parse running container info GetContainerID(podUID, containerName string) (string, error) GetContainerSpec(podUID, containerName string) (*v1.Container, error) // GetPod returns Pod by UID GetPod(ctx context.Context, podUID string) (*v1.Pod, error) }
func NewPodFetcher ¶
func NewPodFetcher(conf *config.Configuration, emitter metrics.MetricEmitter) (PodFetcher, error)
type PodFetcherStub ¶
func (*PodFetcherStub) GetContainerID ¶
func (p *PodFetcherStub) GetContainerID(podUID, containerName string) (string, error)
func (*PodFetcherStub) GetContainerSpec ¶
func (p *PodFetcherStub) GetContainerSpec(podUID, containerName string) (*v1.Container, error)
func (*PodFetcherStub) GetPodList ¶
func (*PodFetcherStub) Run ¶
func (p *PodFetcherStub) Run(_ context.Context)
type RuntimePod ¶
type RuntimePod struct { // The UID of the pod, which can be used to retrieve a particular pod // from the pod list returned by GetPods(). UID kubetypes.UID // The name and namespace of the pod, which is readable by human. Name string Namespace string // List of containers that belongs to this pod. It may contain only // running containers, or mixed with dead ones (when GetPods(true)). Containers []*runtimeapi.Container // List of sandboxes associated with this pod. This is only populated // by kuberuntime. Sandboxes []*runtimeapi.PodSandbox }
RuntimePod is a group of containers.
type RuntimePodFetcher ¶
type RuntimePodFetcher interface {
GetPods(all bool) ([]*RuntimePod, error)
}
func NewRuntimePodFetcher ¶
func NewRuntimePodFetcher(conf *config.Configuration) (RuntimePodFetcher, error)
Click to show internal directories.
Click to hide internal directories.