consts

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: Apache-2.0 Imports: 2 Imported by: 5

Documentation

Overview

Package consts provides most useful constant for Liqo Controllers

Index

Constants

View Source
const (
	// OverrideAddressAnnotation is the annotation used to override the address of a service.
	OverrideAddressAnnotation = "liqo.io/override-address"
	// OverridePortAnnotation is the annotation used to override the port of a service.
	OverridePortAnnotation = "liqo.io/override-port"

	// APIServerSupportAnnotation is the annotation used to enable the API server support for a pod.
	APIServerSupportAnnotation = "liqo.io/api-server-support"
	// APIServerSupportAnnotationValueRemote is the value of the annotation used to enable the API server support for a pod.
	APIServerSupportAnnotationValueRemote = "remote"
	// APIServerSupportAnnotationValueDisabled is the value of the annotation used to disable the API server support for a pod.
	APIServerSupportAnnotationValueDisabled = "disabled"

	// RemoteServiceAccountNameAnnotation is the annotation used to set the name of the service account used by a pod
	// in the remote cluster. This annotation requires the API server support to be "remote" for the pod and the
	// remote service account to be created.
	RemoteServiceAccountNameAnnotation = "liqo.io/remote-service-account-name"
)
View Source
const (
	// ClusterIDLabelName is the name of the label key to use with Cluster ID.
	ClusterIDLabelName = "clusterID"
	// ClusterIDConfigMapKey is the key of the configmap where the cluster-id is stored.
	ClusterIDConfigMapKey = "CLUSTER_ID"
	// ClusterNameConfigMapKey is the key of the configmap where the cluster-name is stored.
	ClusterNameConfigMapKey = "CLUSTER_NAME"
	// ClusterIDConfigMapNameLabelValue value of the name key of the configmap used to get it by label.
	ClusterIDConfigMapNameLabelValue = "clusterid-configmap"
)
View Source
const (
	// ProviderClusterLabel is the cluster label used to indicate the cluster provider.
	ProviderClusterLabel = "liqo.io/provider"
	// TopologyRegionClusterLabel is the cluster label used to indicate the cluster region.
	TopologyRegionClusterLabel = "topology.kubernetes.io/region"
)
View Source
const (
	// DefaultLiqoNamespace represents the default namespace where liqo is installed in.
	DefaultLiqoNamespace = "liqo"

	// AuthServiceName contains the name of the Liqo Authentication service.
	AuthServiceName = "liqo-auth"
)
View Source
const (
	// K8sAppNameKey = key of the label used to denote a deployed application name.
	K8sAppNameKey = "app.kubernetes.io/name"
	// K8sAppComponentKey = key of the label used to denote a deployed application component.
	K8sAppComponentKey = "app.kubernetes.io/component"

	// GatewayServiceLabelKey key of the label used to get the service.
	GatewayServiceLabelKey = "net.liqo.io/gateway"
	// GatewayServiceLabelValue value of the label used to get the service.
	GatewayServiceLabelValue = "true"

	// AuthAppName label value that denotes the name of the liqo-auth deployment.
	AuthAppName = "auth"

	// NetworkManagerAppName label value that denotes the name of the liqo-network-manager deployment.
	NetworkManagerAppName = "network-manager"

	// ControllerManagerAppName label value that denotes the name of the liqo-controller-manager deployment.
	ControllerManagerAppName = "controller-manager"

	// APIServerProxyAppName label value that denotes the name of the liqo-api-server-proxy deployment.
	APIServerProxyAppName = "proxy"
	// NatMappingResourceLabelKey is the constant representing
	// the key of the label assigned to all NatMapping resources.
	NatMappingResourceLabelKey = "net.liqo.io/natmapping"
	// NatMappingResourceLabelValue is the constant representing
	// the value of the label assigned to all NatMapping resources.
	NatMappingResourceLabelValue = "true"
	// IpamStorageResourceLabelKey is the constant representing
	// the key of the label assigned to all IpamStorage resources.
	IpamStorageResourceLabelKey = "net.liqo.io/ipamstorage"
	// IpamStorageResourceLabelValue is the constant representing
	// the value of the label assigned to all IpamStorage resources.
	IpamStorageResourceLabelValue = "true"
)
View Source
const (
	// NetworkManagerIpamPort is the port used by IPAM gRPCs.
	NetworkManagerIpamPort = 6000
	// DefaultCIDRValue is the default value for a string that contains a CIDR.
	DefaultCIDRValue = "None"
	// NatMappingKind is the constant representing
	// the value of the Kind field of all NatMapping resources.
	NatMappingKind = "NatMapping"
	// RoutingTableID used to identify the custom routing table used
	// to configure the routes on the k8s nodes by route operator.
	RoutingTableID = 18952
	// OverlayNetPrefix prefix of the subnet used for the overlay network.
	// The last three octets of the IP addresses used for the vxlan devices,
	// are taken from the IPs of the nodes. In next PRs it will be introduced
	// new method to allocate non conflict IPs from a user defined subnet for
	// the overlay interfaces.
	OverlayNetPrefix = "240"
	// LiqoRouteOperatorName holds the name of the route operator.
	LiqoRouteOperatorName = "liqo-route"
	// LiqoGatewayOperatorName name of the operator.
	LiqoGatewayOperatorName = "liqo-gateway"
	// LiqoNetworkManagerName name of the operator.
	LiqoNetworkManagerName = "liqo-network-manager"
	// GatewayLeaderElectionID used as name for the lease.coordination.k8s.io resource.
	GatewayLeaderElectionID = "1d5hml1.gateway.net.liqo.io"
	// GatewayNetnsName name of the custom network namespace used by liqo-gateway.
	GatewayNetnsName = "liqo-netns"
	// HostVethName name of the veth device living in the host network namespace,
	// on the node where liqo-gateway is running.
	HostVethName = "liqo.host"
	// HostVethIPAddr is used as next hop when configuring routes for traffic coming
	// from the gateway namespace. A trick to prevent arp requests for the traffic going
	// through the veth pair.
	HostVethIPAddr = "169.254.100.2"
	// GatewayVethName nome of the veth device living in the custom network namespace
	// created by liqo-gateway.
	GatewayVethName = "liqo.gateway"
	// GatewayVethIPAddr is used as next hop when configuring routes for traffic coming
	// from the host namespace. A trick to prevent arp requests for the traffic going
	// through the veth pair.
	GatewayVethIPAddr = "169.254.100.1"
	// VxlanDeviceName name used for the vxlan devices created on each node by the instances
	// of liqo-route.
	VxlanDeviceName = "liqo.vxlan"
	// OverlayNetworkPrefix prefix used for the overlay network.
	OverlayNetworkPrefix = "240"
	// OverlayNetworkMask size of the overlay network.
	OverlayNetworkMask = "/8"
	// PodCIDR is a field of the TunnelEndpoint resource.
	PodCIDR = "PodCIDR"
	// ExternalCIDR is a field of the TunnelEndpoint resource.
	ExternalCIDR = "ExternalCIDR"
	// LocalPodCIDR is a field of the TunnelEndpoint resource.
	LocalPodCIDR = "LocalPodCIDR"
	// LocalExternalCIDR is a field of the TunnelEndpoint resource.
	LocalExternalCIDR = "LocalExternalCIDR"
	// LocalNATPodCIDR is a field of the TunnelEndpoint resource.
	LocalNATPodCIDR = "LocalNATPodCIDR"
	// LocalNATExternalCIDR is a field of the TunnelEndpoint resource.
	LocalNATExternalCIDR = "LocalNATExternalCIDR"
	// RemoteNATPodCIDR is a field of the TunnelEndpoint resource.
	RemoteNATPodCIDR = "RemoteNATPodCIDR"
	// RemoteNATExternalCIDR is a field of the TunnelEndpoint resource.
	RemoteNATExternalCIDR = "RemoteNATExternalCIDR"
	// FinalizersSuffix suffix used by the network operators to create the finalizers added to k8s resources.
	FinalizersSuffix = "net.liqo.io"
	// UDPMinPort min value for a udp port.
	UDPMinPort = 1
	// UDPMaxPort max value for a udp port.
	UDPMaxPort = 65535
	// DefaultMTU default value for the mtu used in the network interfaces managed by the network operators.
	// Used by:
	//  - the route operator for the vxlan interfaces;
	//  - the gateway operator for vpn tunnel and veth pair between host network namespace and custom network namespace.
	DefaultMTU = 1440
	// GatewayListeningPort port used by the vpn tunnel.
	GatewayListeningPort = 5871
	// NotApplicable is a constant used to represent a not applicable value.
	NotApplicable = "N/A"

	// GatewayServiceAnnotationKey used to annotate the Gateway service with the IP of the node where the
	// active gateway is running.
	GatewayServiceAnnotationKey = "net.liqo.io/gatewayNodeIP"
	// NetworkConfigNamePrefix prefix used to generate the names of the networkconfigs.
	NetworkConfigNamePrefix = "net-config-"
)
View Source
const (
	// RemoteClusterID is used to obtain cluster-id from different Liqo resources.
	RemoteClusterID = "liqo.io/remote-cluster-id"
	// TypeLabel is the key of a Liqo label that identifies different types of nodes.
	// todo: change to NodeTypeLabel
	TypeLabel = "liqo.io/type"
	// TypeNode is the value of a Liqo label that identifies Liqo virtual nodes.
	// todo: change to VirtualNodeType
	TypeNode = "virtual-node"
	// DocumentationURL is the URL to official Liqo Documentation.
	DocumentationURL = "https://doc.liqo.io/"
	// DefaultNamespaceOffloadingName is the default name of NamespaceOffloading resources. Every namespace that has
	// to be offloaded with Liqo, must have a NamespaceOffloading resource with this name.
	DefaultNamespaceOffloadingName = "offloading"
	// SchedulingLiqoLabel is necessary in order to allow Pods to be scheduled on remote clusters.
	SchedulingLiqoLabel = "liqo.io/scheduling-enabled"
	// SchedulingLiqoLabelValue unique value allowed for SchedulingLiqoLabel.
	SchedulingLiqoLabelValue = "true"

	// RemoteNamespaceManagedByAnnotationKey is the annotation that identifies the NamespaceMap managing a given remote namespace.
	RemoteNamespaceManagedByAnnotationKey = "liqo.io/managed-by-namespace-map"
	// RemoteNamespaceOriginalNameAnnotationKey is the annotation that identifies the original name of a remote namespace.
	RemoteNamespaceOriginalNameAnnotationKey = "liqo.io/original-name"
	// RemoteNamespaceClusterRoleName is the name of the cluster role used to grant permissions to the virtual kubelet in remote namespaces.
	RemoteNamespaceClusterRoleName = "liqo-virtual-kubelet-remote"
)
View Source
const (
	// ClusterNameParameter is the name of the parameter specifying the cluster name.
	ClusterNameParameter = "cluster-name"
	// ClusterLabelsParameter is the name of the parameter specifying the cluster labels.
	ClusterLabelsParameter = "cluster-labels"
	// ReservedSubnetsParameter is the name of the parameter specifying the cluster's reserved subnets.
	ReservedSubnetsParameter = "reserved-subnets"
	// EnableLanDiscoveryParameter is the name of the parameter specifying whether the lan discovery is enabled.
	EnableLanDiscoveryParameter = "enable-lan-discovery"
	// GenerateNameParameter is the name of the parameter specifying whether to generate a random name for the cluster.
	GenerateNameParameter = "generate-name"

	// ResourcePluginAddressParameter is the name of the parameter specifying the address of a resource plugin.
	ResourcePluginAddressParameter = "resource-plugin-address"
)
View Source
const (
	// OwnershipLocal indicates that the resource is owned by the local cluster.
	OwnershipLocal OwnershipType = "Local"
	// OwnershipShared indicates that the ownership over the resource is shared between the two clusters.
	// In particular:
	// - the spec of the resource is owned by the local cluster.
	// - the status by the remote cluster.
	OwnershipShared OwnershipType = "Shared"

	// AllowList reflects only the resources with a specific annotation.
	AllowList ReflectionType = "AllowList"
	// DenyList reflects all the resources excluding the ones with a specific annotation.
	DenyList ReflectionType = "DenyList"
	// CustomLiqo reflects the resources following the custom Liqo logic.
	CustomLiqo ReflectionType = "CustomLiqo"

	// ReplicationRequestedLabel is the key of a label indicating whether the given resource should be replicated remotely.
	ReplicationRequestedLabel = "liqo.io/replication"
	// ReplicationRequestedLabelValue is the value of a label indicating that the given resource should be replicated remotely.
	ReplicationRequestedLabelValue = "true"
	// ReplicationOriginLabel is the key of a label indicating the origin cluster of a replicated resource.
	ReplicationOriginLabel = "liqo.io/originID"
	// ReplicationDestinationLabel is the key of a label indicating the destination cluster of a replicated resource.
	ReplicationDestinationLabel = "liqo.io/remoteID"
	// ReplicationStatusLabel is the key of a label indicating that this resource has been created by a remote cluster through replication.
	ReplicationStatusLabel = "liqo.io/replicated"

	// LocalPodLabelKey label key added to all the local pods that have been offloaded/replicated to a remote cluster.
	LocalPodLabelKey = "liqo.io/shadowPod"
	// LocalPodLabelValue value of the label added to the local pods that have been offloaded/replicated to a remote cluster.
	LocalPodLabelValue = "true"

	// ManagedByLabelKey is the label key used to indicate that a given resource is managed by another one.
	ManagedByLabelKey = "liqo.io/managed-by"
	// ManagedByShadowPodValue it the label value used to indicate that a given resource is managed by a ShadowPod.
	ManagedByShadowPodValue = "shadowpod"
	// ManagedByShadowEndpointSliceValue it the label value used to indicate that a given resource is managed by a ShadowEndpointSlice.
	ManagedByShadowEndpointSliceValue = "shadowendpointslice"

	// LocalResourceOwnership label key added to a resource when it is owned by a local component.
	// Ex. Local networkconfigs are owned by the component that creates them. If the resource is replicated in
	// a remote cluster this label is removed by the CRDReplicator.
	LocalResourceOwnership = "liqo.io/ownership"

	// ForceRemoteNodePortAnnotationKey is the annotation key used to indicate that a service should be forced to
	// use the same node port on both clusters.
	ForceRemoteNodePortAnnotationKey = "liqo.io/force-remote-node-port"

	// SkipReflectionAnnotationKey is the annotation key used to indicate that a given object should not be reflected into a remote cluster.
	SkipReflectionAnnotationKey = "liqo.io/skip-reflection"

	// AllowReflectionAnnotationKey is the annotation key used to indicate that a given object should be reflected into a remote cluster.
	AllowReflectionAnnotationKey = "liqo.io/allow-reflection"

	// PodAntiAffinityPresetKey is the annotation key used to express an anti-affinity preset to apply to offloaded pods.
	PodAntiAffinityPresetKey = "liqo.io/anti-affinity-preset"

	// PodAntiAffinityPresetValueSoft is the annotation value corresponding to the "soft" anti-affinity preset (i.e., preferred).
	PodAntiAffinityPresetValueSoft = "soft"

	// PodAntiAffinityPresetValueHard is the annotation value corresponding to the "hard" anti-affinity preset (i.e., required).
	PodAntiAffinityPresetValueHard = "hard"

	// PodAntiAffinityPresetValuePropagate is the annotation value corresponding to the propagation of the original pod anti-affinity constrains.
	PodAntiAffinityPresetValuePropagate = "propagate"

	// PodAntiAffinityLabelsKey is the annotation key used to specify a subset of the pod label keys for the anti-affinity constraints.
	PodAntiAffinityLabelsKey = "liqo.io/anti-affinity-labels"

	// RemoteUnavailableKey is the annotation key indicating that the remote cluster hosting the local offloaded pod is currently not available.
	RemoteUnavailableKey = "liqo.io/remote-unavailable"
	// RemoteUnavailableValue is the annotation value of the label indicating that the remote cluster hosting the local offloaded pod is currently
	// not available.
	RemoteUnavailableValue = "true"
)
View Source
const (
	// StorageProvisionerName is the name of the liqo storage provisioner.
	StorageProvisionerName = "liqo.io/storage"

	// StorageAvailableLabel is the label used to mark if the liqo storage is available on a virtual node.
	StorageAvailableLabel = "storage.liqo.io/available"

	// VirtualPvcNamespaceLabel is the label used to mark the namespace of a virtual PVC.
	VirtualPvcNamespaceLabel = "storage.liqo.io/virtual-pvc-namespace"
	// VirtualPvcNameLabel is the label used to mark the name of a virtual PVC.
	VirtualPvcNameLabel = "storage.liqo.io/virtual-pvc-name"

	// StorageNamespaceLabel is the label used to mark the liqo storage namespace.
	StorageNamespaceLabel = "liqo.io/storage-provisioner"
)
View Source
const (
	// PublicKey is the key of publicKey entry in back-end map and also for the secret containing the wireguard keys.
	PublicKey = "publicKey"
	// ListeningPort is the key of the listeningPort entry in the back-end map.
	ListeningPort = "port"
	// DeviceName name of wireguard tunnel created on the custom network namespace.
	DeviceName = "liqo.tunnel"
	// DriverName  name of the driver which is also used as the type of the backend in tunnelendpoint CRD.
	DriverName = "wireguard"
	// KeysLabel label for the secret that contains the public key.
	KeysLabel = "net.liqo.io/key"
	// WgTunnelIP is the IP address of the wireguard tunnel interface.
	WgTunnelIP = "169.254.0.1"
	// WgEndpointIP is the key of the endpointIP entry in back-end map of wireguard interface.
	WgEndpointIP = "endpointIP"
	// WgPrivateKey is the key of the private key entry for the secret containing the wireguard keys.
	WgPrivateKey = "privateKey"
	// WgAllowedIPs is the key of the allowedIPs entry in the back-end map of wireguard interface.
	WgAllowedIPs = "allowedIPs"
	// WgKeysName is the name of the secret that contains the public key used by wireguard.
	WgKeysName = "wireguard-pubkey"
)
View Source
const (
	// ResourceOfferNameLabel is the label used to identify the related ResourceOffer.
	ResourceOfferNameLabel = "resourceoffer.liqo.io/name"
)
View Source
const (
	// VirtualNodeTolerationKey all Pods that have to be scheduled on virtual nodes must have this toleration
	// to Liqo taint.
	VirtualNodeTolerationKey = "virtual-node.liqo.io/not-allowed"
)

Variables

This section is empty.

Functions

func ClusterIDConfigMapSelector added in v0.3.1

func ClusterIDConfigMapSelector() labels.Selector

ClusterIDConfigMapSelector returns the selector for the configmap where the cluster-id is stored.

func LiqoRouteFinalizer added in v0.6.0

func LiqoRouteFinalizer(podIP string) string

LiqoRouteFinalizer returns the finalizer used by the route operator, based on its pod IP.

Types

type OwnershipType

type OwnershipType string

OwnershipType indicates the type of ownership over a resource.

type PeeringPhase

type PeeringPhase string

PeeringPhase contains the status of the peering with a remote cluster.

const (
	// PeeringPhaseNone -> no pering has been established.
	PeeringPhaseNone PeeringPhase = "None"
	// PeeringPhaseAuthenticated -> an identity to interact with the remote cluster is available.
	PeeringPhaseAuthenticated PeeringPhase = "Authenticated"
	// PeeringPhaseEstablished -> the peering has been established (either incoming or outgoing).
	PeeringPhaseEstablished PeeringPhase = "Established"
	// PeeringPhaseIncoming -> an incoming peering has been established.
	PeeringPhaseIncoming PeeringPhase = "Incoming"
	// PeeringPhaseOutgoing -> an outgoing peering has been established.
	PeeringPhaseOutgoing PeeringPhase = "Outgoing"
	// PeeringPhaseBidirectional -> both incoming and outgoing peerings have been established.
	PeeringPhaseBidirectional PeeringPhase = "Bidirectional"
)

type ReflectionType added in v0.9.4

type ReflectionType string

ReflectionType is the type of reflection.

type SecurityModeType added in v0.10.0

type SecurityModeType string

SecurityModeType represents different security modes regarding connectivity among clusters.

const (
	// FullPodToPodSecurityMode represents the default security mode: full pod-to-pod connectivity.
	FullPodToPodSecurityMode SecurityModeType = "FullPodToPod"
	// IntraClusterTrafficSegregationSecurityMode represents security mode that allows remote clusters to contact:
	// - their pods offloaded in the local cluster
	// - endpoints of local services reflected on them.
	IntraClusterTrafficSegregationSecurityMode SecurityModeType = "IntraClusterTrafficSegregation"
)

Jump to

Keyboard shortcuts

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