kube

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KubernetesIOServiceNameLabel = "kubernetes.io/service-name"
)

Variables

This section is empty.

Functions

func ClientFromConfig

func ClientFromConfig(path string) (*kubernetes.Clientset, error)

ClientFromConfig returns a Kubernetes client (clientset) from the kubeconfig path or from the in-cluster service account environment.

func NewClient added in v0.3.0

func NewClient(token, apiURL, caURL string) (*clientWrapper, error)

func NewClientFromConfig added in v0.2.0

func NewClientFromConfig(path string) (*clientWrapper, error)

NewClientFromConfig returns a client from the given kubeconfig path or from the in-cluster service account environment.

func NewClientMock added in v0.2.0

func NewClientMock(paths ...string) *clientMock

NewClientMock creates a new mock client and loads Kubernetes resources from the passed yaml files

Types

type Client added in v0.2.0

type Client interface {
	WatchAll(crdQ, endpointSliceQ *queue.Queue, stopCh <-chan struct{}) error
	WatchEndpointSlices(endpointSliceQ *queue.Queue, stopCh <-chan struct{}) error
	KubeClient() kubernetes.Interface
	Service(namespace, name string) (*corev1.Service, error)
	EndpointSlice(name, namespace string) (*discoveryv1.EndpointSlice, error)
	EndpointSliceList(labelSelector, namespace string) ([]*discoveryv1.EndpointSlice, error)
	XdsServiceList() ([]*v1alpha1.XdsService, error)
}

Client interface for a Kubernetes config. Will be used to watch all needed resources and update the stores.

type ServiceEventHandler

type ServiceEventHandler = func(eventType watch.EventType, old *v1.Service, new *v1.Service)

type ServiceWatcher

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

func NewServiceWatcher

func NewServiceWatcher(client kubernetes.Interface, resyncPeriod time.Duration, handler ServiceEventHandler, labelSelector, namespace string) *ServiceWatcher

func (*ServiceWatcher) Get

func (sw *ServiceWatcher) Get(name, namespace string) (*v1.Service, error)

func (*ServiceWatcher) HasSynced

func (sw *ServiceWatcher) HasSynced() bool

func (*ServiceWatcher) Init

func (sw *ServiceWatcher) Init()

func (*ServiceWatcher) List

func (sw *ServiceWatcher) List() ([]*v1.Service, error)

func (*ServiceWatcher) Run

func (sw *ServiceWatcher) Run()

func (*ServiceWatcher) Stop

func (sw *ServiceWatcher) Stop()

Jump to

Keyboard shortcuts

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