helpers

package
Version: v0.0.0-...-d88c8b5 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// LoadBalancerCleanupFinalizer is the finalizer added to load balancer
	// services to ensure the Service resource is not fully deleted until
	// the correlating load balancer resources are deleted.
	LoadBalancerCleanupFinalizer = "service.kubernetes.io/load-balancer-cleanup"
)

Variables

This section is empty.

Functions

func GetLoadBalancerSourceRanges

func GetLoadBalancerSourceRanges(service *v1.Service) (utilnet.IPNetSet, error)

GetLoadBalancerSourceRanges first try to parse and verify LoadBalancerSourceRanges field from a service. If the field is not specified, turn to parse and verify the AnnotationLoadBalancerSourceRangesKey annotation from a service, extracting the source ranges to allow, and if not present returns a default (allow-all) value.

func GetServiceHealthCheckPathPort

func GetServiceHealthCheckPathPort(service *v1.Service) (string, int32)

GetServiceHealthCheckPathPort returns the path and nodePort programmed into the Cloud LB Health Check

func HasLBFinalizer

func HasLBFinalizer(service *v1.Service) bool

HasLBFinalizer checks if service contains LoadBalancerCleanupFinalizer.

func IsAllowAll

func IsAllowAll(ipnets utilnet.IPNetSet) bool

IsAllowAll checks whether the utilnet.IPNet allows traffic from 0.0.0.0/0

func LoadBalancerStatusEqual

func LoadBalancerStatusEqual(l, r *v1.LoadBalancerStatus) bool

LoadBalancerStatusEqual checks if load balancer status are equal

func NeedsHealthCheck

func NeedsHealthCheck(service *v1.Service) bool

NeedsHealthCheck checks if service needs health check.

func PatchService

func PatchService(c corev1.CoreV1Interface, oldSvc, newSvc *v1.Service) (*v1.Service, error)

PatchService patches the given service's Status or ObjectMeta based on the original and updated ones. Change to spec will be ignored.

func RequestsOnlyLocalTraffic

func RequestsOnlyLocalTraffic(service *v1.Service) bool

RequestsOnlyLocalTraffic checks if service requests OnlyLocal traffic.

Types

This section is empty.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL