kube

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Client

func Client(token, apiURL, caURL string) (*kubernetes.Clientset, error)

Client returns a Kubernetes client (clientset) from token, apiURL and caURL

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 CreateService added in v0.4.0

func CreateService(ctx context.Context, client kubernetes.Interface, name, namespace string, labels, annotations map[string]string, ports []v1.ServicePort, headless bool) (*v1.Service, error)

CreateService creates a clusterIP or headless type service.

func DeleteService added in v0.4.0

func DeleteService(ctx context.Context, client kubernetes.Interface, name, namespace string) error

DeleteService returns a client delete service request

func GetService added in v0.4.0

func GetService(ctx context.Context, client kubernetes.Interface, name, namespace string) (*v1.Service, error)

GetService returns a client get request for a service under a namespace

func UpdateService added in v0.4.0

func UpdateService(ctx context.Context, client kubernetes.Interface, service *v1.Service, ports []v1.ServicePort) (*v1.Service, error)

UpdateService updates service ports. No need to cater for headless services as clusterIP field is immutable and will fail.

Types

type EndpointSliceEventHandler added in v0.4.0

type EndpointSliceEventHandler = func(eventType watch.EventType, old *discoveryv1.EndpointSlice, new *discoveryv1.EndpointSlice)

type EndpointSliceWatcher added in v0.4.0

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

func NewEndpointSliceWatcher added in v0.4.0

func NewEndpointSliceWatcher(name string, client kubernetes.Interface, resyncPeriod time.Duration, handler EndpointSliceEventHandler, labelSelector, namespace, runner string) *EndpointSliceWatcher

func (*EndpointSliceWatcher) Get added in v0.4.0

func (esw *EndpointSliceWatcher) Get(name, namespace string) (*discoveryv1.EndpointSlice, error)

func (*EndpointSliceWatcher) HasSynced added in v0.4.0

func (esw *EndpointSliceWatcher) HasSynced() bool

func (*EndpointSliceWatcher) Init added in v0.4.0

func (esw *EndpointSliceWatcher) Init()

func (*EndpointSliceWatcher) List added in v0.4.0

func (*EndpointSliceWatcher) Run added in v0.4.0

func (esw *EndpointSliceWatcher) Run()

func (*EndpointSliceWatcher) Stop added in v0.4.0

func (esw *EndpointSliceWatcher) Stop()

type EndpointsEventHandler

type EndpointsEventHandler = func(eventType watch.EventType, old *v1.Endpoints, new *v1.Endpoints)

type EndpointsWatcher

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

func NewEndpointsWatcher

func NewEndpointsWatcher(name string, client kubernetes.Interface, resyncPeriod time.Duration, handler EndpointsEventHandler, labelSelector, namespace, runner string) *EndpointsWatcher

func (*EndpointsWatcher) Get

func (ew *EndpointsWatcher) Get(name, namespace string) (*v1.Endpoints, error)

func (*EndpointsWatcher) Init

func (ew *EndpointsWatcher) Init()

func (*EndpointsWatcher) List added in v0.2.3

func (ew *EndpointsWatcher) List() ([]*v1.Endpoints, error)

func (*EndpointsWatcher) Run

func (ew *EndpointsWatcher) Run()

func (*EndpointsWatcher) Stop

func (ew *EndpointsWatcher) Stop()

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(name string, client kubernetes.Interface, resyncPeriod time.Duration, handler ServiceEventHandler, labelSelector, namespace, runner string) *ServiceWatcher

func (*ServiceWatcher) Get added in v0.2.3

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