k8s

package
v0.127.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	CoreClientset kubernetes.Interface
}

Client is a wrapper for Kubernetes clientset.

func NewClient

func NewClient() (*Client, error)

NewClient creates a Client instance.

func (*Client) ListPods

func (c *Client) ListPods(ctx context.Context, namespace string, labels map[string]string) ([]*apiv1.Pod, error)

ListPods lists pods.

type EventHandlerWithContext

type EventHandlerWithContext interface {
	ProcessAdd(ctx context.Context, obj interface{})
	ProcessUpdate(ctx context.Context, oldObj, newObj interface{})
	ProcessDelete(ctx context.Context, obj interface{})
}

EventHandlerWithContext is an interface similar to cache.EventHandler but with a context object.

type Informers

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

Informers keeps multiple informers.

func NewInformers

func NewInformers(
	k8sclient *Client,
	stopCh chan struct{},
	namespace string,
	labels map[string]string,
) (*Informers, error)

NewInformers creates a new Informer for Pod.

func (*Informers) Run added in v0.74.0

func (is *Informers) Run()

Run runs the informer.

func (*Informers) SetPodEventHandlers

func (is *Informers) SetPodEventHandlers(
	ctx context.Context,
	handlers []EventHandlerWithContext,
) error

SetPodEventHandlers sets the specified handlers to the Pod informer.

Jump to

Keyboard shortcuts

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