Documentation ¶
Index ¶
- func Client(token, apiURL, caURL string) (*kubernetes.Clientset, error)
- func ClientFromConfig(path string) (*kubernetes.Clientset, error)
- func CreateService(ctx context.Context, client kubernetes.Interface, name, namespace string, ...) (*v1.Service, error)
- func DeleteService(ctx context.Context, client kubernetes.Interface, name, namespace string) error
- func GetService(ctx context.Context, client kubernetes.Interface, name, namespace string) (*v1.Service, error)
- func UpdateService(ctx context.Context, client kubernetes.Interface, service *v1.Service, ...) (*v1.Service, error)
- type EndpointSliceEventHandler
- type EndpointSliceWatcher
- func (esw *EndpointSliceWatcher) Get(name, namespace string) (*discoveryv1.EndpointSlice, error)
- func (esw *EndpointSliceWatcher) HasSynced() bool
- func (esw *EndpointSliceWatcher) Init()
- func (esw *EndpointSliceWatcher) List() ([]*discoveryv1.EndpointSlice, error)
- func (esw *EndpointSliceWatcher) Run()
- func (esw *EndpointSliceWatcher) Stop()
- type EndpointsEventHandler
- type EndpointsWatcher
- type ServiceEventHandler
- type ServiceWatcher
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
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 (esw *EndpointSliceWatcher) List() ([]*discoveryv1.EndpointSlice, error)
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 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 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) Run ¶
func (sw *ServiceWatcher) Run()
func (*ServiceWatcher) Stop ¶
func (sw *ServiceWatcher) Stop()
Click to show internal directories.
Click to hide internal directories.