Documentation ¶
Index ¶
- Variables
- func GetTrafficProxyNodeSelector(tgb *elbv2api.TargetGroupBinding) (labels.Selector, error)
- func IsNodeSuitableAsTrafficProxy(node *corev1.Node) bool
- func NewDefaultEndpointResolver(k8sClient client.Client, podInfoRepo k8s.PodInfoRepo, failOpenEnabled bool, ...) *defaultEndpointResolver
- type EndpointResolveOption
- type EndpointResolveOptions
- type EndpointResolver
- type EndpointsData
- type NodePortEndpoint
- type PodEndpoint
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("backend not found")
Functions ¶
func GetTrafficProxyNodeSelector ¶
func GetTrafficProxyNodeSelector(tgb *elbv2api.TargetGroupBinding) (labels.Selector, error)
GetTrafficProxyNodeSelector returns the trafficProxy node label selector for specific targetGroupBinding.
func IsNodeSuitableAsTrafficProxy ¶
IsNodeSuitableAsTrafficProxy check whether node is suitable as a traffic proxy. This should be checked in additional to the nodeSelector defined in TargetGroupBinding.
func NewDefaultEndpointResolver ¶
func NewDefaultEndpointResolver(k8sClient client.Client, podInfoRepo k8s.PodInfoRepo, failOpenEnabled bool, endpointSliceEnabled bool, logger logr.Logger) *defaultEndpointResolver
NewDefaultEndpointResolver constructs new defaultEndpointResolver
Types ¶
type EndpointResolveOption ¶
type EndpointResolveOption func(opts *EndpointResolveOptions)
func WithNodeSelector ¶
func WithNodeSelector(nodeSelector labels.Selector) EndpointResolveOption
WithNodeSelector is a option that sets nodeSelector.
func WithPodReadinessGate ¶
func WithPodReadinessGate(cond corev1.PodConditionType) EndpointResolveOption
WithPodReadinessGate is a option that appends podReadinessGate into EndpointResolveOptions.
type EndpointResolveOptions ¶
type EndpointResolveOptions struct { // [NodePort Endpoint] only nodes that are matched by nodeSelector will be included. // By default, no node will be selected. NodeSelector labels.Selector // [Pod Endpoint] if pod readinessGates is defined, then pods from unready addresses with any of these readinessGates and containersReady condition will be included as well. // By default, no readinessGate is specified. PodReadinessGates []corev1.PodConditionType }
options for Endpoints resolve APIs
func (*EndpointResolveOptions) ApplyOptions ¶
func (opts *EndpointResolveOptions) ApplyOptions(options []EndpointResolveOption)
type EndpointResolver ¶
type EndpointResolver interface { // ResolvePodEndpoints will resolve endpoints backed by pods directly. // returns resolved podEndpoints and whether there are unready endpoints that can potentially turn ready in future reconciles. ResolvePodEndpoints(ctx context.Context, svcKey types.NamespacedName, port intstr.IntOrString, opts ...EndpointResolveOption) ([]PodEndpoint, bool, error) // ResolveNodePortEndpoints will resolve endpoints backed by nodePort. ResolveNodePortEndpoints(ctx context.Context, svcKey types.NamespacedName, port intstr.IntOrString, opts ...EndpointResolveOption) ([]NodePortEndpoint, error) }
EndpointResolver resolves the endpoints for specific service & service Port.
type EndpointsData ¶
type EndpointsData struct { Ports []discv1.EndpointPort Endpoints []discv1.Endpoint }
Click to show internal directories.
Click to hide internal directories.