forge

package
v0.11.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package forge contains utility functions to forge resources of the networking module.

Index

Constants

View Source
const (
	DefaultMTU      = 1340
	DefaultProtocol = "UDP"
)

Common default values for the networking module.

View Source
const (
	DefaultGwClientType         = "networking.liqo.io/v1alpha1/wggatewayclienttemplates"
	DefaultGwClientTemplateName = "wireguard-client"
)

Default values for the GatewayClient.

View Source
const (
	DefaultGwServerType         = "networking.liqo.io/v1alpha1/wggatewayservertemplates"
	DefaultGwServerTemplateName = "wireguard-server"
	DefaultGwServerServiceType  = corev1.ServiceTypeLoadBalancer
	DefaultGwServerPort         = 51820
)

Default values for the GatewayServer.

Variables

This section is empty.

Functions

func Configuration

func Configuration(name, namespace string, remoteClusterID liqov1alpha1.ClusterID,
	podCIDR, externalCIDR string) *networkingv1alpha1.Configuration

Configuration forges a Configuration resource of a remote cluster.

func ConfigurationForRemoteCluster

func ConfigurationForRemoteCluster(ctx context.Context, cl client.Client,
	namespace, liqoNamespace string) (*networkingv1alpha1.Configuration, error)

ConfigurationForRemoteCluster forges a Configuration of the local cluster to be applied to a remote cluster. It retrieves the local configuration settings starting from the cluster identity and the IPAM storage.

func DefaultConfigurationName

func DefaultConfigurationName(remoteClusterID liqov1alpha1.ClusterID) string

DefaultConfigurationName returns the default name for a Configuration.

func DefaultGatewayClientName

func DefaultGatewayClientName(remoteClusterID liqov1alpha1.ClusterID) string

DefaultGatewayClientName returns the default name for a GatewayClient.

func DefaultGatewayServerName

func DefaultGatewayServerName(remoteClusterID liqov1alpha1.ClusterID) string

DefaultGatewayServerName returns the default name for a GatewayServer.

func DefaultPublicKeyName

func DefaultPublicKeyName(remoteClusterID liqov1alpha1.ClusterID) string

DefaultPublicKeyName returns the default name of a PublicKey.

func GatewayClient

func GatewayClient(name, namespace string, o *GwClientOptions) (*networkingv1alpha1.GatewayClient, error)

GatewayClient forges a GatewayClient.

func GatewayServer

func GatewayServer(name, namespace string, o *GwServerOptions) (*networkingv1alpha1.GatewayServer, error)

GatewayServer forges a GatewayServer.

func MutateConfiguration

func MutateConfiguration(conf *networkingv1alpha1.Configuration, remoteClusterID liqov1alpha1.ClusterID, podCIDR, externalCIDR string)

MutateConfiguration mutates a Configuration resource of a remote cluster.

func MutateGatewayClient

func MutateGatewayClient(gwClient *networkingv1alpha1.GatewayClient, o *GwClientOptions) error

MutateGatewayClient mutates a GatewayClient.

func MutateGatewayServer

func MutateGatewayServer(gwServer *networkingv1alpha1.GatewayServer, o *GwServerOptions) error

MutateGatewayServer mutates a GatewayServer.

func MutatePublicKey

func MutatePublicKey(pubKey *networkingv1alpha1.PublicKey, remoteClusterID liqov1alpha1.ClusterID, key []byte) error

MutatePublicKey mutates a PublicKey.

func PublicKey

func PublicKey(name, namespace string, remoteClusterID liqov1alpha1.ClusterID, key []byte) (*networkingv1alpha1.PublicKey, error)

PublicKey forges a PublicKey.

func PublicKeyForRemoteCluster

func PublicKeyForRemoteCluster(ctx context.Context, cl client.Client,
	liqoNamespace, namespace, gatewayName, gatewayType string) (*networkingv1alpha1.PublicKey, error)

PublicKeyForRemoteCluster forges a PublicKey to be applied on a remote cluster.

Types

type GwClientOptions

type GwClientOptions struct {
	KubeClient        kubernetes.Interface
	RemoteClusterID   liqov1alpha1.ClusterID
	GatewayType       string
	TemplateName      string
	TemplateNamespace string
	MTU               int
	Addresses         []string
	Port              int32
	Protocol          string
}

GwClientOptions encapsulate the options to forge a GatewayClient.

type GwServerOptions

type GwServerOptions struct {
	KubeClient        kubernetes.Interface
	RemoteClusterID   liqov1alpha1.ClusterID
	GatewayType       string
	TemplateName      string
	TemplateNamespace string
	ServiceType       corev1.ServiceType
	MTU               int
	Port              int32
	NodePort          *int32
	LoadBalancerIP    *string
}

GwServerOptions encapsulate the options to forge a GatewayServer.

Jump to

Keyboard shortcuts

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