service

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: Apache-2.0, BSD-2-Clause, MIT, + 1 more Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ControllerName is the name of the Azure service controller.
	ControllerName = "azureservice-controller"
	// ActuatorName is the name of the Azure service actuator.
	ActuatorName = "azureservice-actuator"
	// PredicateName is the name of the predicate of the Azure service controller.
	PredicateName = "azureservice-predicate"
	// PublicIPAddressPredicateName is the name of the predicate of the Azure service controller for filtering publicipaddress events.
	PublicIPAddressPredicateName = "azureservice-publicipaddress-predicate"
	// FinalizerName is the finalizer to put on service resources.
	FinalizerName = "azure.remedy.gardener.cloud/service"
)
View Source
const (
	// CacheTTL is the TTL for service cache entries.
	CacheTTL = 10 * time.Hour
)

Variables

View Source
var (
	// DefaultAddOptions are the default AddOptions for AddToManager.
	DefaultAddOptions = AddOptions{
		Config: config.AzureOrphanedPublicIPRemedyConfiguration{
			ServiceSyncPeriod: metav1.Duration{Duration: 4 * time.Hour},
		},
	}

	// ObjectLabeler is used to label publicipaddress objects created by this controller.
	ObjectLabeler = remedycontroller.NewNamespacedObjectLabeler(".")
)

Functions

func AddToManager

func AddToManager(mgr manager.Manager) error

AddToManager adds a controller with the default AddOptions to the given manager.

func AddToManagerWithOptions

func AddToManagerWithOptions(mgr manager.Manager, options AddOptions) error

AddToManagerWithOptions adds a controller with the given AddOptions to the given manager.

func NewActuator

func NewActuator(client client.Client, namespace string, syncPeriod time.Duration, logger logr.Logger) controller.Actuator

NewActuator creates a new Actuator.

func NewPredicate added in v0.9.0

func NewPredicate(serviceCache utils.ExpiringCache, logger logr.Logger) predicate.Predicate

NewPredicate creates a new predicate that filters only relevant service events, such as creating or deleting a service, updating the deletion timestamp of a service with LoadBalancer IPs, updating the ignore annotation of a service with LoadBalancer IPs, and updating the service LoadBalancer IPs.

Types

type AddOptions

type AddOptions struct {
	// Controller are the controller.Options.
	Controller controller.Options
	// Client is the Kubernetes client for the control cluster.
	Client client.Client
	// Namespace is the namespace for custom resources in the control cluster.
	Namespace string
	// Manager is the control cluster manager.
	Manager manager.Manager
	// Config is the configuration for the Azure orphaned public IP remedy.
	Config config.AzureOrphanedPublicIPRemedyConfiguration
}

AddOptions are options to apply when adding a controller to a manager.

type Projection added in v0.9.0

type Projection struct {
	DeletionTimestamp *metav1.Time
	ShouldIgnore      bool
	LoadBalancerIPs   map[string]bool
}

Projection captures only the essential properties of a service that is being cached. By using projections, we prevent the cache from getting too big for clusters with large number of services.

func NewProjection added in v0.9.0

func NewProjection(service *corev1.Service) *Projection

NewProjection creates a new Projection from the given service.

Jump to

Keyboard shortcuts

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