targetgroupbinding

package
v0.0.0-...-ba4152c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Prefix for TargetHealth pod condition type.
	TargetHealthPodConditionTypePrefix = "target-health.elbv2.k8s.aws"
	// Legacy Prefix for TargetHealth pod condition type(used by AWS ALB Ingress Controller)
	TargetHealthPodConditionTypePrefixLegacy = "target-health.alb.ingress.k8s.aws"

	// Index Key for "ServiceReference" index.
	IndexKeyServiceRefName = "spec.serviceRef.name"
)

Variables

This section is empty.

Functions

func BuildTargetHealthPodConditionType

func BuildTargetHealthPodConditionType(tgb *elbv2api.TargetGroupBinding) corev1.PodConditionType

BuildTargetHealthPodConditionType constructs the condition type for TargetHealth pod condition.

func GetTGBReconcileCheckpoint

func GetTGBReconcileCheckpoint(tgb *elbv2api.TargetGroupBinding) string

GetTGBReconcileCheckpoint gets the sha256 hash saved in the annotations

func GetTGBReconcileCheckpointTimestamp

func GetTGBReconcileCheckpointTimestamp(tgb *elbv2api.TargetGroupBinding) int64

GetTGBReconcileCheckpointTimestamp gets the latest updated timestamp (in seconds) for the TGB checkpoint

func IndexFuncServiceRefName

func IndexFuncServiceRefName(obj client.Object) []string

IndexFuncServiceRefName is IndexFunc for "ServiceReference" index.

func NewCachedTargetsManager

func NewCachedTargetsManager(elbv2Client services.ELBV2, logger logr.Logger) *cachedTargetsManager

NewCachedTargetsManager constructs new cachedTargetsManager

func NewDefaultNetworkingManager

func NewDefaultNetworkingManager(k8sClient client.Client, podENIResolver networking.PodENIInfoResolver, nodeENIResolver networking.NodeENIInfoResolver,
	sgManager networking.SecurityGroupManager, sgReconciler networking.SecurityGroupReconciler, vpcID string, clusterName string, serviceTargetENISGTags map[string]string, logger logr.Logger, disabledRestrictedSGRulesFlag bool) *defaultNetworkingManager

NewDefaultNetworkingManager constructs defaultNetworkingManager.

func NewDefaultResourceManager

func NewDefaultResourceManager(k8sClient client.Client, elbv2Client services.ELBV2, ec2Client services.EC2,
	podInfoRepo k8s.PodInfoRepo, sgManager networking.SecurityGroupManager, sgReconciler networking.SecurityGroupReconciler,
	vpcInfoProvider networking.VPCInfoProvider, multiClusterManager MultiClusterManager, metricsCollector lbcmetrics.MetricCollector,
	vpcID string, clusterName string, failOpenEnabled bool, endpointSliceEnabled bool, disabledRestrictedSGRulesFlag bool,
	endpointSGTags map[string]string,
	eventRecorder record.EventRecorder, logger logr.Logger) *defaultResourceManager

NewDefaultResourceManager constructs new defaultResourceManager.

func SaveTGBReconcileCheckpoint

func SaveTGBReconcileCheckpoint(tgb *elbv2api.TargetGroupBinding, checkpoint string)

SaveTGBReconcileCheckpoint updates the TGB object with a new checkpoint string.

func UniqueIDForTargetDescription

func UniqueIDForTargetDescription(target elbv2types.TargetDescription) string

UniqueIDForTargetDescription generates a unique ID to differentiate targets.

Types

type MultiClusterManager

type MultiClusterManager interface {
	// FilterTargetsForDeregistration Given a list of targets, filter the list down to only targets the cluster should operate on.
	FilterTargetsForDeregistration(ctx context.Context, tgb *elbv2api.TargetGroupBinding, targetInfo []TargetInfo) ([]TargetInfo, bool, error)

	// UpdateTrackedIPTargets Update the tracked target set in persistent storage
	UpdateTrackedIPTargets(ctx context.Context, updateRequested bool, endpoints []backend.PodEndpoint, tgb *elbv2api.TargetGroupBinding) error

	// UpdateTrackedInstanceTargets Update the tracked target set in persistent storage
	UpdateTrackedInstanceTargets(ctx context.Context, updateRequested bool, endpoints []backend.NodePortEndpoint, tgb *elbv2api.TargetGroupBinding) error

	// CleanUp Removes any resources used to implement multicluster support.
	CleanUp(ctx context.Context, tgb *elbv2api.TargetGroupBinding) error
}

MultiClusterManager implements logic to support multiple LBCs managing the same Target Group.

func NewMultiClusterManager

func NewMultiClusterManager(kubeClient client.Client, apiReader client.Reader, logger logr.Logger) MultiClusterManager

NewMultiClusterManager constructs a multicluster manager that is immediately ready to use.

type NetworkingManager

type NetworkingManager interface {
	// ReconcileForPodEndpoints reconcile network settings for TargetGroupBindings with podEndpoints.
	ReconcileForPodEndpoints(ctx context.Context, tgb *elbv2api.TargetGroupBinding, endpoints []backend.PodEndpoint) error

	// ReconcileForNodePortEndpoints reconcile network settings for TargetGroupBindings with nodePortEndpoints.
	ReconcileForNodePortEndpoints(ctx context.Context, tgb *elbv2api.TargetGroupBinding, endpoints []backend.NodePortEndpoint) error

	// Cleanup reconcile network settings for TargetGroupBindings with zero endpoints.
	Cleanup(ctx context.Context, tgb *elbv2api.TargetGroupBinding) error
}

NetworkingManager manages the networking for targetGroupBindings.

type ResourceManager

type ResourceManager interface {
	Reconcile(ctx context.Context, tgb *elbv2api.TargetGroupBinding) (bool, error)
	Cleanup(ctx context.Context, tgb *elbv2api.TargetGroupBinding) error
}

ResourceManager manages the TargetGroupBinding resource.

type TargetInfo

type TargetInfo struct {
	// The target's description
	Target elbv2types.TargetDescription

	// The target's health information.
	// If absent, the target's health information is unknown.
	TargetHealth *elbv2types.TargetHealth
}

TargetInfo contains information about a TargetGroup target.

func (*TargetInfo) GetIdentifier

func (t *TargetInfo) GetIdentifier() string

GetIdentifier this should match backend.Endpoint

func (*TargetInfo) IsDraining

func (t *TargetInfo) IsDraining() bool

IsDraining returns whether target is in draining state.

func (*TargetInfo) IsHealthy

func (t *TargetInfo) IsHealthy() bool

IsHealthy returns whether target is healthy.

func (*TargetInfo) IsInitial

func (t *TargetInfo) IsInitial() bool

IsInitial returns whether target is in initial state.

func (*TargetInfo) IsNotRegistered

func (t *TargetInfo) IsNotRegistered() bool

IsNotRegistered returns whether target is not registered.

type TargetsManager

type TargetsManager interface {
	// Register Targets into TargetGroup.
	RegisterTargets(ctx context.Context, tgARN string, targets []elbv2types.TargetDescription) error

	// Deregister Targets from TargetGroup.
	DeregisterTargets(ctx context.Context, tgARN string, targets []elbv2types.TargetDescription) error

	// List Targets from TargetGroup.
	ListTargets(ctx context.Context, tgARN string) ([]TargetInfo, error)
}

TargetsManager is an abstraction around ELBV2's targets API.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL