Documentation
¶
Index ¶
- Constants
- func BuildTargetHealthPodConditionType(tgb *elbv2api.TargetGroupBinding) corev1.PodConditionType
- func GetTGBReconcileCheckpoint(tgb *elbv2api.TargetGroupBinding) string
- func GetTGBReconcileCheckpointTimestamp(tgb *elbv2api.TargetGroupBinding) int64
- func IndexFuncServiceRefName(obj client.Object) []string
- func NewCachedTargetsManager(elbv2Client services.ELBV2, logger logr.Logger) *cachedTargetsManager
- func NewDefaultResourceManager(k8sClient client.Client, elbv2Client services.ELBV2, ...) *defaultResourceManager
- func SaveTGBReconcileCheckpoint(tgb *elbv2api.TargetGroupBinding, checkpoint string)
- func UniqueIDForTargetDescription(target elbv2types.TargetDescription) string
- type MultiClusterManager
- type ResourceManager
- type TargetInfo
- type TargetsManager
Constants ¶
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 ¶
IndexFuncServiceRefName is IndexFunc for "ServiceReference" index.
func NewCachedTargetsManager ¶
NewCachedTargetsManager constructs new cachedTargetsManager
func NewDefaultResourceManager ¶
func NewDefaultResourceManager(k8sClient client.Client, elbv2Client services.ELBV2, podInfoRepo k8s.PodInfoRepo, networkingManager networking.NetworkingManager, vpcInfoProvider networking.VPCInfoProvider, multiClusterManager MultiClusterManager, metricsCollector lbcmetrics.MetricCollector, vpcID string, failOpenEnabled bool, endpointSliceEnabled bool, 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 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, tgb *elbv2api.TargetGroupBinding, targets []elbv2types.TargetDescription) error // Deregister Targets from TargetGroup. DeregisterTargets(ctx context.Context, tgb *elbv2api.TargetGroupBinding, targets []elbv2types.TargetDescription) error // List Targets from TargetGroup. ListTargets(ctx context.Context, tgb *elbv2api.TargetGroupBinding) ([]TargetInfo, error) }
TargetsManager is an abstraction around ELBV2's targets API.