Documentation ¶
Overview ¶
Package endpointslice contains the core logic of endpointslice controller.
Index ¶
- func ServiceControllerKey(endpointSlice *discovery.EndpointSlice) (string, error)
- type Reconciler
- func (r *Reconciler) DeleteService(namespace, name string)
- func (r *Reconciler) GetControllerName() string
- func (r *Reconciler) ManagedByChanged(endpointSlice1, endpointSlice2 *discovery.EndpointSlice) bool
- func (r *Reconciler) ManagedByController(endpointSlice *discovery.EndpointSlice) bool
- func (r *Reconciler) Reconcile(logger klog.Logger, service *corev1.Service, pods []*corev1.Pod, ...) error
- type ReconcilerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ServiceControllerKey ¶
func ServiceControllerKey(endpointSlice *discovery.EndpointSlice) (string, error)
ServiceControllerKey returns a controller key for a Service but derived from an EndpointSlice.
Types ¶
type Reconciler ¶
type Reconciler struct {
// contains filtered or unexported fields
}
Reconciler is responsible for transforming current EndpointSlice state into desired state
func NewReconciler ¶
func NewReconciler(client clientset.Interface, nodeLister corelisters.NodeLister, maxEndpointsPerSlice int32, endpointSliceTracker *endpointsliceutil.EndpointSliceTracker, topologyCache *topologycache.TopologyCache, eventRecorder record.EventRecorder, controllerName string, options ...ReconcilerOption) *Reconciler
func (*Reconciler) DeleteService ¶
func (r *Reconciler) DeleteService(namespace, name string)
func (*Reconciler) GetControllerName ¶
func (r *Reconciler) GetControllerName() string
func (*Reconciler) ManagedByChanged ¶
func (r *Reconciler) ManagedByChanged(endpointSlice1, endpointSlice2 *discovery.EndpointSlice) bool
ManagedByChanged returns true if one of the provided EndpointSlices is managed by the EndpointSlice controller while the other is not.
func (*Reconciler) ManagedByController ¶
func (r *Reconciler) ManagedByController(endpointSlice *discovery.EndpointSlice) bool
ManagedByController returns true if the controller of the provided EndpointSlices is the EndpointSlice controller.
func (*Reconciler) Reconcile ¶
func (r *Reconciler) Reconcile(logger klog.Logger, service *corev1.Service, pods []*corev1.Pod, existingSlices []*discovery.EndpointSlice, triggerTime time.Time) error
Reconcile takes a set of pods currently matching a service selector and compares them with the endpoints already present in any existing endpoint slices for the given service. It creates, updates, or deletes endpoint slices to ensure the desired set of pods are represented by endpoint slices.
type ReconcilerOption ¶ added in v0.30.0
type ReconcilerOption func(*Reconciler)
func WithTrafficDistributionEnabled ¶ added in v0.30.0
func WithTrafficDistributionEnabled(enabled bool) ReconcilerOption
WithTrafficDistributionEnabled controls whether the Reconciler considers the `trafficDistribution` field while reconciling EndpointSlices.
Directories ¶
Path | Synopsis |
---|---|
trafficdist handles reconciliation of hints for trafficDistribution field.
|
trafficdist handles reconciliation of hints for trafficDistribution field. |