kube

package
v1.21.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer added in v1.7.0

func NewServer(client *Client) kubepb.KubeAPIServer

Types

type AddListener added in v1.7.0

type AddListener interface {
	OnAdd(obj Object)
}

type Client

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

func NewClient

func NewClient(
	log *logging.Logger,
	podName, kvisorNamespace string,
	version Version,
	client kubernetes.Interface,
) *Client

func (*Client) GetClusterInfo added in v1.7.0

func (c *Client) GetClusterInfo() (*ClusterInfo, error)

func (*Client) GetIPInfo added in v1.7.0

func (c *Client) GetIPInfo(ip netip.Addr) (IPInfo, bool)

func (*Client) GetKvisorAgentImageDetails

func (c *Client) GetKvisorAgentImageDetails() (ImageDetails, error)

GetKvisorAgentImageDetails returns kvisor agent image details. This is used for image analyzer and kube-bench dynamic jobs to schedule using the same image.

func (*Client) GetOwnerUID

func (c *Client) GetOwnerUID(obj Object) string

func (*Client) GetPodInfo added in v1.9.2

func (c *Client) GetPodInfo(uid string) (*PodInfo, bool)

func (*Client) RegisterHandlers

func (c *Client) RegisterHandlers(factory informers.SharedInformerFactory)

func (*Client) RegisterKubernetesChangeListener

func (c *Client) RegisterKubernetesChangeListener(l KubernetesChangeEventListener)

func (*Client) RegisterPodsHandlers

func (c *Client) RegisterPodsHandlers(factory informers.SharedInformerFactory)

func (*Client) Run

func (c *Client) Run(ctx context.Context) error

func (*Client) UnregisterKubernetesChangeListener added in v1.7.0

func (c *Client) UnregisterKubernetesChangeListener(l KubernetesChangeEventListener)

type ClusterInfo added in v1.7.0

type ClusterInfo struct {
	PodCidr     string
	ServiceCidr string
}

type DeleteListener added in v1.7.0

type DeleteListener interface {
	OnDelete(obj Object)
}

type EventType

type EventType string
const (
	EventAdd    EventType = "add"
	EventUpdate EventType = "update"
	EventDelete EventType = "delete"
)

type IPEndpoint added in v1.7.0

type IPEndpoint struct {
	ID        string
	Name      string
	Namespace string
	Labels    map[string]string
}

type IPInfo added in v1.7.0

type IPInfo struct {
	IP       string
	PodInfo  *PodInfo
	Service  *corev1.Service
	Node     *corev1.Node
	Endpoint *IPEndpoint
}

type ImageDetails

type ImageDetails struct {
	ScannerImageName string
	ImagePullSecrets []corev1.LocalObjectReference
}

type Index added in v1.7.0

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

func NewIndex added in v1.7.0

func NewIndex() *Index

type KubernetesChangeEventListener

type KubernetesChangeEventListener interface {
	RequiredTypes() []reflect.Type
}

type Object

type Object interface {
	runtime.Object
	metav1.Object
}

type PodInfo added in v1.9.2

type PodInfo struct {
	Pod   *corev1.Pod
	Owner metav1.OwnerReference
	Zone  string
}

type PodLogProvider

type PodLogProvider interface {
	GetLogReader(ctx context.Context, podNs, podName string) (io.ReadCloser, error)
}

func NewPodLogReader

func NewPodLogReader(client kubernetes.Interface) PodLogProvider

type Server added in v1.7.0

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

func (*Server) GetClusterInfo added in v1.7.0

func (*Server) GetIPInfo added in v1.7.0

func (*Server) GetPod added in v1.7.0

type UpdateListener added in v1.7.0

type UpdateListener interface {
	OnUpdate(obj Object)
}

type Version

type Version struct {
	Full     string
	MinorInt int
}

func GetVersion

func GetVersion(clientset kubernetes.Interface) (Version, error)

Jump to

Keyboard shortcuts

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