Documentation ¶
Index ¶
- Constants
- Variables
- func Equal(fr1, fr2 *composite.ForwardingRule) (bool, error)
- func GCEResourceName(ingAnnotations map[string]string, resourceName string) string
- func GetLBAnnotations(l7 *L7, existing map[string]string, backendSyncer backends.Syncer) (map[string]string, error)
- func InsertForwardingRuleHook(ctx context.Context, key *meta.Key, obj *compute.ForwardingRule, ...) (b bool, e error)
- func InsertGlobalForwardingRuleHook(ctx context.Context, key *meta.Key, obj *compute.ForwardingRule, ...) (b bool, e error)
- type L4
- type L7
- func (l *L7) Cleanup(versions *features.ResourceVersions) error
- func (l *L7) CreateKey(name string) (*meta.Key, error)
- func (l *L7) GetIP() string
- func (l *L7) Regional() bool
- func (l *L7) RuntimeInfo() *L7RuntimeInfo
- func (l *L7) String() string
- func (l *L7) UrlMap() *composite.UrlMap
- func (l *L7) Versions() *features.ResourceVersions
- type L7RuntimeInfo
- type L7s
- func (l *L7s) Ensure(ri *L7RuntimeInfo) (*L7, error)
- func (l *L7s) FrontendScopeChangeGC(ing *v1.Ingress) (*meta.KeyType, error)
- func (l *L7s) GCv1(names []string) error
- func (l *L7s) GCv2(ing *v1.Ingress, scope meta.KeyType) error
- func (l *L7s) HasUrlMap(ing *v1.Ingress) (bool, error)
- func (l *L7s) Shutdown(ings []*v1.Ingress) error
- type LoadBalancerPool
- type SyncResult
Constants ¶
const ( SyncTypeCreate = "create" SyncTypeUpdate = "update" SyncTypeDelete = "delete" )
const FakeCertQuota = 15
const SslCertificateMissing = "SslCertificateMissing"
const (
// Every target https proxy accepts upto 10 ssl certificates.
TargetProxyCertLimit = 10
)
Variables ¶
var ILBResourceAnnotationKeys = []string{ annotations.BackendServiceKey, annotations.TCPForwardingRuleKey, annotations.UDPForwardingRuleKey, annotations.HealthcheckKey, annotations.FirewallRuleKey, annotations.FirewallRuleForHealthcheckKey}
Functions ¶
func GCEResourceName ¶
GCEResourceName retrieves the name of the gce resource created for this Ingress, of the given resource type, by inspecting the map of ingress annotations.
func GetLBAnnotations ¶
func GetLBAnnotations(l7 *L7, existing map[string]string, backendSyncer backends.Syncer) (map[string]string, error)
GetLBAnnotations returns the annotations of an l7. This includes it's current status.
func InsertForwardingRuleHook ¶ added in v1.9.0
func InsertGlobalForwardingRuleHook ¶ added in v1.7.0
Types ¶
type L4 ¶ added in v1.9.0
type L4 struct { Service *corev1.Service ServicePort utils.ServicePort NamespacedName types.NamespacedName // contains filtered or unexported fields }
Many of the functions in this file are re-implemented from gce_loadbalancer_internal.go L4 handles the resource creation/deletion/update for a given L4 ILB service.
func NewL4Handler ¶ added in v1.9.0
func NewL4Handler(service *corev1.Service, cloud *gce.Cloud, scope meta.KeyType, namer namer.L4ResourcesNamer, recorder record.EventRecorder, lock *sync.Mutex) *L4
NewL4Handler creates a new L4Handler for the given L4 service.
func (*L4) CreateKey ¶ added in v1.9.0
CreateKey generates a meta.Key for a given GCE resource name.
func (*L4) EnsureInternalLoadBalancer ¶ added in v1.9.0
func (l *L4) EnsureInternalLoadBalancer(nodeNames []string, svc *corev1.Service) *SyncResult
EnsureInternalLoadBalancer ensures that all GCE resources for the given loadbalancer service have been created. It returns a LoadBalancerStatus with the updated ForwardingRule IP address.
func (*L4) EnsureInternalLoadBalancerDeleted ¶ added in v1.9.0
func (l *L4) EnsureInternalLoadBalancerDeleted(svc *corev1.Service) *SyncResult
EnsureInternalLoadBalancerDeleted performs a cleanup of all GCE resources for the given loadbalancer service.
type L7 ¶
type L7 struct {
// contains filtered or unexported fields
}
L7 represents a single L7 loadbalancer.
func (*L7) Cleanup ¶
func (l *L7) Cleanup(versions *features.ResourceVersions) error
Cleanup deletes resources specific to this l7 in the right order. forwarding rule -> target proxy -> url map This leaves backends and health checks, which are shared across loadbalancers.
func (*L7) RuntimeInfo ¶ added in v1.2.2
func (l *L7) RuntimeInfo() *L7RuntimeInfo
RuntimeInfo returns the L7RuntimeInfo associated with the L7 load balancer.
func (*L7) String ¶ added in v1.8.0
String returns the name of the loadbalancer. Warning: This should be used only for logging and should not be used to retrieve/ delete gce resource names.
func (*L7) Versions ¶ added in v1.7.0
func (l *L7) Versions() *features.ResourceVersions
Versions returns the struct listing the versions for every resource
type L7RuntimeInfo ¶
type L7RuntimeInfo struct { // IP is the desired ip of the loadbalancer, eg from a staticIP. IP string // TLS are the tls certs to use in termination. TLS []*translator.TLSCerts // TLSName is the name of the preshared cert to use. Multiple certs can be specified as a comma-separated string TLSName string // Ingress is the processed Ingress API object. Ingress *v1.Ingress // AllowHTTP will not setup :80, if TLS is nil and AllowHTTP is set, // no loadbalancer is created. AllowHTTP bool // The name of a Global/Regional Static IP. If specified, the IP associated with // this name is used in the Forwarding Rules for this loadbalancer. // If this is an l7-ILB ingress, the static IP is assumed to be internal StaticIPName string // The name of the static IP subnet, this is only used for L7-ILB Ingress static IPs StaticIPSubnet string // UrlMap is our internal representation of a url map. UrlMap *utils.GCEURLMap // FrontendConfig is the type which encapsulates features for the load balancer. FrontendConfig *frontendconfigv1beta1.FrontendConfig }
L7RuntimeInfo is info passed to this module from the controller runtime.
type L7s ¶
type L7s struct {
// contains filtered or unexported fields
}
L7s implements LoadBalancerPool.
func (*L7s) Ensure ¶ added in v1.5.0
func (l *L7s) Ensure(ri *L7RuntimeInfo) (*L7, error)
Ensure implements LoadBalancerPool.
func (*L7s) FrontendScopeChangeGC ¶ added in v1.9.10
FrontendScopeChangeGC returns the scope to GC if the LB has changed scopes (e.g. when a user migrates from ILB to ELB on the same ingress or vice versa.) This only applies to the V2 Naming Scheme TODO(shance): Refactor to avoid calling GCE every sync loop
func (*L7s) GCv1 ¶ added in v1.8.0
GCv1 implements LoadBalancerPool. TODO(shance): Update to handle regional and global LB with same name
type LoadBalancerPool ¶
type LoadBalancerPool interface { // Ensure ensures a loadbalancer and its resources given the RuntimeInfo. Ensure(ri *L7RuntimeInfo) (*L7, error) // GCv2 garbage collects loadbalancer associated with given ingress using v2 naming scheme. GCv2(ing *v1.Ingress, scope meta.KeyType) error // GCv1 garbage collects loadbalancers not in the input list using v1 naming scheme. GCv1(names []string) error // FrontendScopeChangeGC checks if GC is needed for an ingress that has changed scopes FrontendScopeChangeGC(ing *v1.Ingress) (*meta.KeyType, error) // Shutdown deletes all loadbalancers for given list of ingresses. Shutdown(ings []*v1.Ingress) error // HasUrlMap returns true if an URL map exists in GCE for given ingress. HasUrlMap(ing *v1.Ingress) (bool, error) }
LoadBalancerPool is an interface to manage the cloud resources associated with a gce loadbalancer.
func NewLoadBalancerPool ¶
func NewLoadBalancerPool(cloud *gce.Cloud, v1NamerHelper namer_util.V1FrontendNamer, recorderProducer events.RecorderProducer, namerFactory namer_util.IngressFrontendNamerFactory) LoadBalancerPool
NewLoadBalancerPool returns a new loadbalancer pool.
- cloud: implements LoadBalancers. Used to sync L7 loadbalancer resources with the cloud.
type SyncResult ¶ added in v1.11.2
type SyncResult struct { Annotations map[string]string Error error GCEResourceInError string Status *corev1.LoadBalancerStatus MetricsState metrics.L4ILBServiceState SyncType string StartTime time.Time }
SyncResult contains information about the outcome of an L4 ILB sync. It stores the list of resource name annotations, sync error, the GCE resource that hit the error along with the error type and more fields.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
TODO: (shance) this file should ideally be combined with backends/features This file contains functionality and constants for the L7-ILB feature Since this also currently affects backend resources (since they are alpha-regional instead of ga-global), this feature is also included in pkg/backends/features.go
|
TODO: (shance) this file should ideally be combined with backends/features This file contains functionality and constants for the L7-ILB feature Since this also currently affects backend resources (since they are alpha-regional instead of ga-global), this feature is also included in pkg/backends/features.go |