config

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: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildRestConfig

func BuildRestConfig(rtCfg RuntimeConfig) (*rest.Config, error)

BuildRestConfig builds the REST config for the controller runtime

func BuildRuntimeOptions

func BuildRuntimeOptions(rtCfg RuntimeConfig, scheme *runtime.Scheme) ctrl.Options

BuildRuntimeOptions builds the options for the controller runtime based on config

Types

type AddonsConfig

type AddonsConfig struct {
	// WAF addon for ALB
	WAFEnabled bool
	// WAFV2 addon for ALB
	WAFV2Enabled bool
	// Shield addon for ALB
	ShieldEnabled bool
}

AddonsConfig contains configuration for the addon features

func (*AddonsConfig) BindFlags

func (f *AddonsConfig) BindFlags(fs *pflag.FlagSet)

BindFlags binds the command line flags to the fields in the config object

type ControllerConfig

type ControllerConfig struct {
	// Log level for the controller logs
	LogLevel string
	// Name of the Kubernetes cluster
	ClusterName string
	// Configurations for AWS.
	AWSConfig aws.CloudConfig
	// Configurations for the Controller Runtime
	RuntimeConfig RuntimeConfig
	// Configurations for Pod inject webhook
	PodWebhookConfig inject.Config
	// Configurations for the Ingress controller
	IngressConfig IngressConfig
	// Configurations for Addons feature
	AddonsConfig AddonsConfig
	// Configurations for the Service controller
	ServiceConfig ServiceConfig

	// Default AWS Tags that will be applied to all AWS resources managed by this controller.
	DefaultTags map[string]string

	// Default target type for Ingress and Service objects
	DefaultTargetType string

	// Default scheme for ELB
	DefaultLoadBalancerScheme string

	// List of Tag keys on AWS resources that will be managed externally.
	ExternalManagedTags []string

	// ServiceTargetENISGTags are AWS tags, in addition to the cluster tags, for finding the target ENI security group to which to add inbound rules from NLBs.
	ServiceTargetENISGTags map[string]string

	// Default SSL Policy that will be applied to all ingresses or services that do not have
	// the SSL Policy annotation.
	DefaultSSLPolicy string

	// Enable EndpointSlices for IP targets instead of Endpoints
	EnableEndpointSlices bool

	// Max concurrent reconcile loops for Service objects
	ServiceMaxConcurrentReconciles int
	// Max concurrent reconcile loops for TargetGroupBinding objects
	TargetGroupBindingMaxConcurrentReconciles int
	// Max exponential backoff delay for reconcile failures of TargetGroupBinding
	TargetGroupBindingMaxExponentialBackoffDelay time.Duration

	// EnableBackendSecurityGroup specifies whether to use optimized security group rules
	EnableBackendSecurityGroup bool

	// BackendSecurityGroups specifies the configured backend security group to use
	// for optimized security group rules
	BackendSecurityGroup string

	// DisableRestrictedSGRules specifies whether to use restricted security group rules
	DisableRestrictedSGRules bool

	// LBStabilizationMonitorInterval specifies the duration of interval to monitor the load balancer state for stabilization
	LBStabilizationMonitorInterval time.Duration

	FeatureGates FeatureGates
}

ControllerConfig contains the controller configuration

func (*ControllerConfig) BindFlags

func (cfg *ControllerConfig) BindFlags(fs *pflag.FlagSet)

BindFlags binds the command line flags to the fields in the config object

func (*ControllerConfig) Validate

func (cfg *ControllerConfig) Validate() error

Validate the controller configuration

type Feature

type Feature string
const (
	ListenerRulesTagging         Feature = "ListenerRulesTagging"
	WeightedTargetGroups         Feature = "WeightedTargetGroups"
	ServiceTypeLoadBalancerOnly  Feature = "ServiceTypeLoadBalancerOnly"
	EndpointsFailOpen            Feature = "EndpointsFailOpen"
	EnableServiceController      Feature = "EnableServiceController"
	EnableIPTargetType           Feature = "EnableIPTargetType"
	EnableRGTAPI                 Feature = "EnableRGTAPI"
	SubnetsClusterTagCheck       Feature = "SubnetsClusterTagCheck"
	NLBHealthCheckAdvancedConfig Feature = "NLBHealthCheckAdvancedConfig"
	NLBSecurityGroup             Feature = "NLBSecurityGroup"
	ALBSingleSubnet              Feature = "ALBSingleSubnet"
	LBCapacityReservation        Feature = "LBCapacityReservation"
)

type FeatureGates

type FeatureGates interface {
	// Enabled returns whether a feature is enabled
	Enabled(feature Feature) bool

	// Enable will enable a feature
	Enable(feature Feature)

	// Disable will disable a feature
	Disable(feature Feature)

	// BindFlags bind featureGates flags
	BindFlags(fs *pflag.FlagSet)
}

func NewFeatureGates

func NewFeatureGates() FeatureGates

NewFeatureGates constructs new featureGates

type IngressConfig

type IngressConfig struct {
	// Name of the Ingress class this controller satisfies.
	// If empty, all with a `kubernetes.io/ingress.class`
	// annotation of `alb` get considered.
	// Also, if empty, all ingresses without either a `kubernetes.io/ingress.class` annotation or
	// an IngressClassName get considered.
	IngressClass string

	// DisableIngressClassAnnotation specifies whether to disable new use of the `kubernetes.io/ingress.class` annotation.
	DisableIngressClassAnnotation bool

	// DisableIngressGroupNameAnnotation specifies whether to disable new use of the `alb.ingress.kubernetes.io/group.name` annotation.
	DisableIngressGroupNameAnnotation bool

	// Max concurrent reconcile loops for Ingress objects
	MaxConcurrentReconciles int

	// TolerateNonExistentBackendService specifies whether to allow rules that reference a backend service that does not
	// exist. In this case, requests to that rule will result in a 503 error.
	TolerateNonExistentBackendService bool

	// TolerateNonExistentBackendAction specifies whether to allow rules that reference a backend action that does not
	// exist. In this case, requests to that rule will result in a 503 error.
	TolerateNonExistentBackendAction bool

	// AllowedCertificateAuthoritiyARNs contains a list of all CAs to consider when discovering certificates for ingress resources
	AllowedCertificateAuthorityARNs []string
}

IngressConfig contains the configurations for the Ingress controller

func (*IngressConfig) BindFlags

func (cfg *IngressConfig) BindFlags(fs *pflag.FlagSet)

BindFlags binds the command line flags to the fields in the config object

type RuntimeConfig

type RuntimeConfig struct {
	APIServer               string
	KubeConfig              string
	WebhookBindPort         int
	MetricsBindAddress      string
	HealthProbeBindAddress  string
	EnableLeaderElection    bool
	LeaderElectionID        string
	LeaderElectionNamespace string
	WatchNamespace          string
	SyncPeriod              time.Duration
	WebhookCertDir          string
	WebhookCertName         string
	WebhookKeyName          string
}

RuntimeConfig stores the configuration for the controller-runtime

func (*RuntimeConfig) BindFlags

func (c *RuntimeConfig) BindFlags(fs *pflag.FlagSet)

BindFlags binds the command line flags to the fields in the config object

type ServiceConfig

type ServiceConfig struct {
	// LoadBalancerClass is the name of the load balancer class reconciled by this controller
	LoadBalancerClass string
}

ServiceConfig contains the configurations for the Service controller

func (*ServiceConfig) BindFlags

func (cfg *ServiceConfig) BindFlags(fs *pflag.FlagSet)

BindFlags binds the command line flags to the fields in the config object

Jump to

Keyboard shortcuts

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