Documentation ¶
Index ¶
- Constants
- func ClientFromConfig(path string) (*kubernetes.Clientset, error)
- func NewClient(token, apiURL, caURL string) (*clientWrapper, error)
- func NewClientFromConfig(path string) (*clientWrapper, error)
- func NewClientMock(paths ...string) *clientMock
- type Client
- type ServiceEventHandler
- type ServiceWatcher
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 NewClientFromConfig ¶ added in v0.2.0
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 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) Run ¶
func (sw *ServiceWatcher) Run()
func (*ServiceWatcher) Stop ¶
func (sw *ServiceWatcher) Stop()
Click to show internal directories.
Click to hide internal directories.