Documentation ¶
Overview ¶
Package forge groups the methods used to forge the Kubernetes object definitions for the reflection logic.
Index ¶
- Constants
- Variables
- func ApplyOptions() metav1.ApplyOptions
- func EndpointSliceLabels() labels.Set
- func EndpointToBeReflected(endpoint *discoveryv1beta1.Endpoint) bool
- func ForeignReplicasetDeleted(pod *corev1.Pod) *corev1.Pod
- func ForeignToHome(foreignObj, homeObj runtime.Object, reflectionType string) (runtime.Object, error)
- func ForeignToHomeStatus(foreignObj, homeObj runtime.Object) (runtime.Object, error)
- func HomeToForeign(homeObj, foreignObj runtime.Object, reflectionType string) (runtime.Object, error)
- func IPAMClient() liqonetIpam.IpamClient
- func InitForger(nattingTable namespacesmapping.NamespaceNatter, opts ...options.ReadOnlyOption)
- func IsEndpointSliceManagedByReflection(obj metav1.Object) bool
- func IsReflected(obj metav1.Object) bool
- func ReflectedLabelSelector() labels.Selector
- func ReflectionLabels() labels.Set
- func RemoteEndpointSlice(local *discoveryv1beta1.EndpointSlice, targetNamespace string, ...) *discoveryv1beta1apply.EndpointSliceApplyConfiguration
- func RemoteEndpointSliceEndpoints(locals []discoveryv1beta1.Endpoint, translator EndpointTranslator) []*discoveryv1beta1apply.EndpointApplyConfiguration
- func RemoteEndpointSlicePorts(locals []discoveryv1beta1.EndpointPort) []*discoveryv1beta1apply.EndpointPortApplyConfiguration
- func RemoteKind(kind string) string
- func RemoteObjectReference(ref *corev1.ObjectReference) *corev1apply.ObjectReferenceApplyConfiguration
- func RemoteService(local *corev1.Service, targetNamespace string) *corev1apply.ServiceApplyConfiguration
- func RemoteServicePorts(locals []corev1.ServicePort) []*corev1apply.ServicePortApplyConfiguration
- func RemoteServiceSpec(local *corev1.ServiceSpec) *corev1apply.ServiceSpecApplyConfiguration
- func ReplicasetFromPod(pod *corev1.Pod) *appsv1.ReplicaSet
- func Tolerations(inputTolerations []corev1.Toleration) []corev1.Toleration
- type EndpointTranslator
Constants ¶
const ( // LiqoOutgoingKey is a label to set on all offloaded resources (deprecated). LiqoOutgoingKey = "virtualkubelet.liqo.io/outgoing" // LiqoOriginClusterIDKey is the key of a label identifying the origin cluster of a reflected resource. LiqoOriginClusterIDKey = "virtualkubelet.liqo.io/origin" // LiqoDestinationClusterIDKey is the key of a label identifying the destination cluster of a reflected resource. LiqoDestinationClusterIDKey = "virtualkubelet.liqo.io/destination" )
const EndpointSliceManagedBy = "endpointslice.reflection.liqo.io"
EndpointSliceManagedBy -> The manager associated with the reflected EndpointSlices.
const ReflectionFieldManager = "reflection.liqo.io"
ReflectionFieldManager -> The name associated with the fields modified by virtual kubelet reflection.
Variables ¶
var ( // LocalClusterID -> the cluster ID associated with the local cluster. LocalClusterID string // RemoteClusterID -> the cluster ID associated with the remote cluster. RemoteClusterID string )
var ( LiqoNodeName = func() string { if forger.virtualNodeName == nil { return "" } return forger.virtualNodeName.Value().ToString() } )
Functions ¶
func ApplyOptions ¶ added in v0.3.1
func ApplyOptions() metav1.ApplyOptions
ApplyOptions returns the apply options configured for object reflection.
func EndpointSliceLabels ¶ added in v0.3.1
EndpointSliceLabels returns the labels assigned to the reflected EndpointSlices.
func EndpointToBeReflected ¶ added in v0.3.1
func EndpointToBeReflected(endpoint *discoveryv1beta1.Endpoint) bool
EndpointToBeReflected filters out the endpoints targeting pods already running on the remote cluster.
func ForeignToHome ¶
func ForeignToHomeStatus ¶
func HomeToForeign ¶
func IPAMClient ¶ added in v0.3.1
func IPAMClient() liqonetIpam.IpamClient
IPAMClient returns the initialized IPAM client.
func InitForger ¶
func InitForger(nattingTable namespacesmapping.NamespaceNatter, opts ...options.ReadOnlyOption)
InitForger initialize forger component to set all necessary fields of offloaded resources.
func IsEndpointSliceManagedByReflection ¶ added in v0.3.1
IsEndpointSliceManagedByReflection returns whether the EndpointSlice is managed by the reflection logic.
func IsReflected ¶ added in v0.3.1
IsReflected returns whether the current object has been reflected from the local to the remote cluster.
func ReflectedLabelSelector ¶ added in v0.3.1
ReflectedLabelSelector returns a label selector matching the objects reflected from the local to the remote cluster.
func ReflectionLabels ¶ added in v0.3.1
ReflectionLabels returns the labels assigned to the objects reflected from the local to the remote cluster.
func RemoteEndpointSlice ¶ added in v0.3.1
func RemoteEndpointSlice(local *discoveryv1beta1.EndpointSlice, targetNamespace string, translator EndpointTranslator) *discoveryv1beta1apply.EndpointSliceApplyConfiguration
RemoteEndpointSlice forges the apply patch for the reflected endpointslice, given the local one.
func RemoteEndpointSliceEndpoints ¶ added in v0.3.1
func RemoteEndpointSliceEndpoints(locals []discoveryv1beta1.Endpoint, translator EndpointTranslator) []*discoveryv1beta1apply.EndpointApplyConfiguration
RemoteEndpointSliceEndpoints forges the apply patch for the endpoints of the reflected endpointslice, given the local ones.
func RemoteEndpointSlicePorts ¶ added in v0.3.1
func RemoteEndpointSlicePorts(locals []discoveryv1beta1.EndpointPort) []*discoveryv1beta1apply.EndpointPortApplyConfiguration
RemoteEndpointSlicePorts forges the apply patch for the ports of the reflected endpointslice, given the local ones.
func RemoteKind ¶ added in v0.3.1
RemoteKind prepends "Remote" to a kind name, to identify remote objects.
func RemoteObjectReference ¶ added in v0.3.1
func RemoteObjectReference(ref *corev1.ObjectReference) *corev1apply.ObjectReferenceApplyConfiguration
RemoteObjectReference forges the apply patch for a reflected RemoteObjectReference.
func RemoteService ¶ added in v0.3.1
func RemoteService(local *corev1.Service, targetNamespace string) *corev1apply.ServiceApplyConfiguration
RemoteService forges the apply patch for the reflected service, given the local one.
func RemoteServicePorts ¶ added in v0.3.1
func RemoteServicePorts(locals []corev1.ServicePort) []*corev1apply.ServicePortApplyConfiguration
RemoteServicePorts forges the apply patch for the ports of the reflected service, given the local ones.
func RemoteServiceSpec ¶ added in v0.3.1
func RemoteServiceSpec(local *corev1.ServiceSpec) *corev1apply.ServiceSpecApplyConfiguration
RemoteServiceSpec forges the apply patch for the specs of the reflected service, given the local ones. It expects the local object to be a deepcopy, as it is mutated.
func ReplicasetFromPod ¶
func ReplicasetFromPod(pod *corev1.Pod) *appsv1.ReplicaSet
func Tolerations ¶ added in v0.3.1
func Tolerations(inputTolerations []corev1.Toleration) []corev1.Toleration
Tolerations forges the tolerations for a reflected pod.
Types ¶
type EndpointTranslator ¶ added in v0.3.1
EndpointTranslator defines the function to translate between local and remote endpoint addresses.