Documentation ¶
Index ¶
- func IsConditionReady(conditions discovery.EndpointConditions) bool
- func UseEndpointSlices(kubeClient kubernetes.Interface) bool
- type Client
- func (c *Client) CreateMlSecret(namespace, controllerDeploymentName, secretName string) error
- func (c *Client) Errorf(svc *v1.Service, kind, msg string, args ...interface{})
- func (c *Client) ForceSync()
- func (c *Client) Infof(svc *v1.Service, kind, msg string, args ...interface{})
- func (c *Client) PodIPs(namespace, labels string) ([]string, error)
- func (c *Client) Run(stopCh <-chan struct{}) error
- func (c *Client) UpdateStatus(svc *v1.Service) error
- type Config
- type EpsOrSliceType
- type EpsOrSlices
- type SyncState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsConditionReady ¶ added in v0.10.0
func IsConditionReady(conditions discovery.EndpointConditions) bool
IsConditionReady tells if the conditions represent a ready state, interpreting nil ready as ready.
func UseEndpointSlices ¶ added in v0.10.0
func UseEndpointSlices(kubeClient kubernetes.Interface) bool
UseEndpointSlices detect if Endpoints Slices are enabled in the cluster.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client watches a Kubernetes cluster and translates events into Controller method calls.
func New ¶ added in v0.4.0
New connects to masterAddr, using kubeconfig to authenticate.
The client uses processName to identify itself to the cluster (e.g. when logging events).
func (*Client) CreateMlSecret ¶ added in v0.10.0
CreateMlSecret create the memberlist secret.
func (*Client) ForceSync ¶ added in v0.9.0
func (c *Client) ForceSync()
ForceSync reprocess all watched services.
func (*Client) PodIPs ¶ added in v0.9.4
PodIPs returns the IPs of all the pods matched by the labels string.
type Config ¶ added in v0.6.0
type Config struct { ProcessName string ConfigMapName string ConfigMapNS string NodeName string MetricsHost string MetricsPort int EnablePprof bool ReadEndpoints bool Logger log.Logger Kubeconfig string DisableEpSlices bool ServiceChanged func(log.Logger, string, *v1.Service, EpsOrSlices) SyncState ConfigChanged func(log.Logger, *config.Config) SyncState ValidateConfig config.Validate NodeChanged func(log.Logger, *v1.Node) SyncState Synced func(log.Logger) }
Config specifies the configuration of the Kubernetes client/watcher.
type EpsOrSliceType ¶ added in v0.10.0
type EpsOrSliceType int
const ( Unknown EpsOrSliceType = iota Eps Slices )
type EpsOrSlices ¶ added in v0.10.0
type EpsOrSlices struct { Type EpsOrSliceType EpVal *v1.Endpoints SlicesVal []*discovery.EndpointSlice }
type SyncState ¶ added in v0.8.0
type SyncState int
SyncState is the result of calling synchronization callbacks.
const ( // The update was processed successfully. SyncStateSuccess SyncState = iota // The update caused a transient error, the k8s client should // retry later. SyncStateError // The update was accepted, but requires reprocessing all watched // services. SyncStateReprocessAll // The update caused a non transient error, the k8s client should // just report and giveup. SyncStateErrorNoRetry )