alb

package
v0.0.0-...-48540e3 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2017 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Listener

type Listener struct {
	IngressID       *string
	CurrentListener *elbv2.Listener
	DesiredListener *elbv2.Listener
	Rules           Rules
	// contains filtered or unexported fields
}

Listener contains the relevant ID, Rules, and current/desired Listeners

func NewListener

func NewListener(annotations *config.Annotations, ingressID *string) []*Listener

NewListener returns a new alb.Listener based on the parameters provided.

func (*Listener) SyncState

func (l *Listener) SyncState(lb *LoadBalancer) *Listener

SyncState compares the current and desired state of this Listener instance. Comparison results in no action, the creation, the deletion, or the modification of an AWS listener to satisfy the ingress's current state.

type Listeners

type Listeners []*Listener

Listeners is a slice of Listener pointers

func (Listeners) Find

func (ls Listeners) Find(listener *elbv2.Listener) int

Find returns the position of the listener, returning -1 if unfound.

func (Listeners) StripCurrentState

func (ls Listeners) StripCurrentState()

StripCurrentState takes all listeners and sets their CurrentListener to nil. Most commonly used when an ELB must be re-created fully. When the deletion of the ELB occurs, the listeners attached are also deleted, thus the ingress controller must know they no longer exist.

Additionally, since Rules are also removed its Listener is, this also calles StripDesiredState on the Rules attached to each listener.

func (Listeners) StripDesiredState

func (ls Listeners) StripDesiredState()

StripDesiredState removes the DesiredListener from all Listeners in the slice.

func (Listeners) SyncState

func (ls Listeners) SyncState(lb *LoadBalancer, tgs *TargetGroups) Listeners

SyncState kicks of the state synchronization for every Listener in this Listeners instances.

type LoadBalancer

type LoadBalancer struct {
	ID                  *string
	IngressID           *string // Same Id as ingress object this comes from.
	Hostname            *string
	CurrentLoadBalancer *elbv2.LoadBalancer // current version of load balancer in AWS
	DesiredLoadBalancer *elbv2.LoadBalancer // current version of load balancer in AWS
	ResourceRecordSet   *ResourceRecordSet
	TargetGroups        TargetGroups
	Listeners           Listeners
	CurrentTags         util.Tags
	DesiredTags         util.Tags
	Deleted             bool // flag representing the LoadBalancer instance was fully deleted.
	LastRulePriority    int64
}

LoadBalancer contains the overarching configuration for the ALB

func NewLoadBalancer

func NewLoadBalancer(clustername, namespace, ingressname, hostname string, ingressID *string, annotations *config.Annotations, tags util.Tags) *LoadBalancer

NewLoadBalancer returns a new alb.LoadBalancer based on the parameters provided.

func (*LoadBalancer) SyncState

func (lb *LoadBalancer) SyncState() *LoadBalancer

SyncState compares the current and desired state of this LoadBalancer instance. Comparison results in no action, the creation, the deletion, or the modification of an AWS ELBV2 (ALB) to satisfy the ingress's current state.

type LoadBalancers

type LoadBalancers []*LoadBalancer

LoadBalancers is a slice of LoadBalancer pointers

func (LoadBalancers) Find

func (l LoadBalancers) Find(lb *LoadBalancer) int

Find returns the position of the lb parameter within the LoadBalancers slice, -1 if it is not found

func (LoadBalancers) StripDesiredState

func (l LoadBalancers) StripDesiredState()

StripDesiredState removes the DesiredLoadBalancers from a LoadBalancers slice

func (LoadBalancers) SyncState

func (l LoadBalancers) SyncState() LoadBalancers

SyncState calls for state synchronization (comparison of current and desired) for the load balancer and its resource record set, target group(s), and listener(s).

type ResourceRecordSet

type ResourceRecordSet struct {
	IngressID                *string
	ZoneID                   *string
	CurrentResourceRecordSet *route53.ResourceRecordSet
	DesiredResourceRecordSet *route53.ResourceRecordSet
}

ResourceRecordSet contains the relevant Route 53 zone id for the host name along with the current and desired state.

func NewResourceRecordSet

func NewResourceRecordSet(hostname *string, ingressID *string) (*ResourceRecordSet, error)

NewResourceRecordSet returns a new route53.ResourceRecordSet based on the LoadBalancer provided.

func (*ResourceRecordSet) PopulateFromLoadBalancer

func (r *ResourceRecordSet) PopulateFromLoadBalancer(lb *elbv2.LoadBalancer)

PopulateFromLoadBalancer configures the DesiredResourceRecordSet with values from a n elbv2.LoadBalancer

func (*ResourceRecordSet) SyncState

SyncState compares the current and desired state of this ResourceRecordSet instance. Comparison results in no action, the creation, the deletion, or the modification of Route 53 resource record set to satisfy the ingress's current state.

type Rule

type Rule struct {
	IngressID   *string
	SvcName     string
	CurrentRule *elbv2.Rule
	DesiredRule *elbv2.Rule
}

Rule contains a current/desired Rule

func NewRule

func NewRule(path extensions.HTTPIngressPath, ingressID *string) *Rule

NewRule returns an alb.Rule based on the provided parameters.

func (*Rule) Equals

func (r *Rule) Equals(target *elbv2.Rule) bool

Equals returns true if the two CurrentRule and target rule are the same Does not compare priority, since this is not supported by the ingress spec

func (*Rule) SyncState

func (r *Rule) SyncState(lb *LoadBalancer, l *Listener) *Rule

SyncState compares the current and desired state of this Rule instance. Comparison results in no action, the creation, the deletion, or the modification of an AWS Rule to satisfy the ingress's current state.

type Rules

type Rules []*Rule

Rules contains a slice of Rules

func (Rules) Find

func (r Rules) Find(rule *elbv2.Rule) int

Find returns the position in the Rules slice of the rule parameter

func (Rules) StripCurrentState

func (r Rules) StripCurrentState()

StripCurrentState removes the CurrentRule reference from all Rule instances. Most commonly used when the Listener it related to has been deleted.

func (Rules) StripDesiredState

func (r Rules) StripDesiredState()

StripDesiredState removes the DesiredListener from all Rules in the slice.

func (Rules) SyncState

func (r Rules) SyncState(lb *LoadBalancer, l *Listener) Rules

SyncState kicks off the state synchronization for every Rule in this Rules slice.

type TargetGroup

type TargetGroup struct {
	ID                 *string
	IngressID          *string
	SvcName            string
	CurrentTags        util.Tags
	DesiredTags        util.Tags
	CurrentTargets     util.AWSStringSlice
	DesiredTargets     util.AWSStringSlice
	CurrentTargetGroup *elbv2.TargetGroup
	DesiredTargetGroup *elbv2.TargetGroup
}

TargetGroup contains the current/desired tags & targetgroup for the ALB

func NewTargetGroup

func NewTargetGroup(annotations *config.Annotations, tags util.Tags, clustername, loadBalancerID *string, port *int64, ingressID *string, svcName string) *TargetGroup

NewTargetGroup returns a new alb.TargetGroup based on the parameters provided.

func (*TargetGroup) SyncState

func (tg *TargetGroup) SyncState(lb *LoadBalancer) *TargetGroup

SyncState compares the current and desired state of this TargetGroup instance. Comparison results in no action, the creation, the deletion, or the modification of an AWS target group to satisfy the ingress's current state.

type TargetGroups

type TargetGroups []*TargetGroup

TargetGroups is a slice of TargetGroup pointers

func (TargetGroups) Find

func (t TargetGroups) Find(tg *TargetGroup) int

Find returns the position of a TargetGroup by its ID, returning -1 if unfound.

func (TargetGroups) LookupBySvc

func (t TargetGroups) LookupBySvc(svc string) int

LookupBySvc returns the position of a TargetGroup by its SvcName, returning -1 if unfound.

func (TargetGroups) StripDesiredState

func (t TargetGroups) StripDesiredState()

StripDesiredState removes the DesiredTags, DesiredTargetGroup, and DesiredTargets from all TargetGroups

func (TargetGroups) SyncState

func (t TargetGroups) SyncState(lb *LoadBalancer) TargetGroups

SyncState kicks off the state synchronization for every target group inside this TargetGroups instance.

Jump to

Keyboard shortcuts

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