k8sapi

package
v1.6.3-rc1 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2020 License: Apache-2.0 Imports: 16 Imported by: 60

Documentation

Overview

Package k8sapi contains logic to retrieve pods running on local node

Index

Constants

This section is empty.

Variables

View Source
var ErrInformerNotSynced = errors.New("discovery: informer not synced")

ErrInformerNotSynced indicates that it has not synced with API server yet

Functions

func CreateKubeClient

func CreateKubeClient() (clientset.Interface, error)

CreateKubeClient creates a k8s client

Types

type Controller

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

Controller defines global context for discovery controller

func NewController

func NewController(clientset kubernetes.Interface) *Controller

NewController creates a new DiscoveryController

func (*Controller) DiscoverCNIK8SPods added in v1.6.1

func (d *Controller) DiscoverCNIK8SPods()

DiscoverCNIK8SPods discovers CNI pods, aws-node, running in the cluster

func (*Controller) DiscoverK8SPods

func (d *Controller) DiscoverK8SPods(podListWatcher *cache.ListWatch)

DiscoverK8SPods takes a watcher and updates the Controller cache

func (*Controller) DiscoverLocalK8SPods added in v1.6.1

func (d *Controller) DiscoverLocalK8SPods()

DiscoverLocalK8SPods discovers local pods running on the node

func (*Controller) GetCNIPods added in v1.5.0

func (d *Controller) GetCNIPods() []string

GetCNIPods return the list of CNI pod names

func (*Controller) K8SGetLocalPodIPs

func (d *Controller) K8SGetLocalPodIPs() ([]*K8SPodInfo, error)

K8SGetLocalPodIPs return the list of pods running on the local nodes

type K8SAPIs

type K8SAPIs interface {
	K8SGetLocalPodIPs() ([]*K8SPodInfo, error)
}

K8SAPIs defines interface to use kubelet introspection API

type K8SPodInfo

type K8SPodInfo struct {
	// Name is pod's name
	Name string
	// Namespace is pod's namespace
	Namespace string
	// Sandbox is pod's sandbox id
	Sandbox string
	// IP is pod's ipv4 address
	IP  string
	UID string
}

K8SPodInfo provides pod info

Directories

Path Synopsis
Package mock_k8sapi is a generated GoMock package.
Package mock_k8sapi is a generated GoMock package.

Jump to

Keyboard shortcuts

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