network

package
v1.0.1 Latest Latest
Warning

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

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

Documentation

Overview

Package network contains the commands to manage the network of Liqo.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	// contains filtered or unexported fields
}

Cluster contains the information about a cluster.

func NewCluster

func NewCluster(ctx context.Context, local, remote *factory.Factory, createTenantNs bool) (*Cluster, error)

NewCluster returns a new Cluster struct.

func (*Cluster) CheckAlreadyEstablishedForGwClient

func (c *Cluster) CheckAlreadyEstablishedForGwClient(ctx context.Context) (bool, error)

CheckAlreadyEstablishedForGwClient checks if a GatewayClient is already established.

func (*Cluster) CheckAlreadyEstablishedForGwServer

func (c *Cluster) CheckAlreadyEstablishedForGwServer(ctx context.Context) (bool, error)

CheckAlreadyEstablishedForGwServer checks if a GatewayServer is already established.

func (*Cluster) CheckNetworkInitialized

func (c *Cluster) CheckNetworkInitialized(ctx context.Context, remoteClusterID liqov1beta1.ClusterID) error

CheckNetworkInitialized checks if the network is initialized correctly in the current cluster.

func (*Cluster) CheckTemplateGwClient

func (c *Cluster) CheckTemplateGwClient(ctx context.Context, opts *Options) error

CheckTemplateGwClient checks if the GatewayClient template is correctly set up.

func (*Cluster) CheckTemplateGwServer

func (c *Cluster) CheckTemplateGwServer(ctx context.Context, opts *Options) error

CheckTemplateGwServer checks if the GatewayServer template is correctly set up.

func (*Cluster) DeleteConfiguration

func (c *Cluster) DeleteConfiguration(ctx context.Context, remoteClusterID liqov1beta1.ClusterID, namespace string) error

DeleteConfiguration deletes a Configuration. If tenantNamespace is empty this function searches in all the namespaces in the cluster.

func (*Cluster) DeleteGatewayClient

func (c *Cluster) DeleteGatewayClient(ctx context.Context, remoteClusterID liqov1beta1.ClusterID) error

DeleteGatewayClient deletes a GatewayClient.

func (*Cluster) DeleteGatewayServer

func (c *Cluster) DeleteGatewayServer(ctx context.Context, remoteClusterID liqov1beta1.ClusterID) error

DeleteGatewayServer deletes a GatewayServer.

func (*Cluster) EnsureGatewayClient

func (c *Cluster) EnsureGatewayClient(ctx context.Context, opts *forge.GwClientOptions) (*networkingv1beta1.GatewayClient, error)

EnsureGatewayClient create or updates a GatewayClient.

func (*Cluster) EnsureGatewayServer

func (c *Cluster) EnsureGatewayServer(ctx context.Context, opts *forge.GwServerOptions) (*networkingv1beta1.GatewayServer, error)

EnsureGatewayServer create or updates a GatewayServer.

func (*Cluster) EnsurePublicKey

func (c *Cluster) EnsurePublicKey(ctx context.Context, remoteClusterID liqov1beta1.ClusterID,
	key []byte, ownerGateway metav1.Object) error

EnsurePublicKey create or updates a PublicKey.

func (*Cluster) SetClusterIDs

func (c *Cluster) SetClusterIDs(ctx context.Context) error

SetClusterIDs set the local and remote cluster id retrieving it from the Liqo configmaps.

func (*Cluster) SetLocalConfiguration

func (c *Cluster) SetLocalConfiguration(ctx context.Context) error

SetLocalConfiguration forges and set a local Configuration to be applied on remote clusters.

func (*Cluster) SetNamespaces

func (c *Cluster) SetNamespaces(ctx context.Context, createTenantNs bool) error

SetNamespaces sets the local and remote namespaces to the liqo-tenants namespaces (creating them if specified), unless the user has explicitly set custom namespaces with the `--namespace` and/or `--remote-namespace` flags. All the external network resources will be created in these namespaces in their respective clusters.

func (*Cluster) SetupConfiguration

func (c *Cluster) SetupConfiguration(ctx context.Context, conf *networkingv1beta1.Configuration) error

SetupConfiguration sets up the network configuration.

type Options

type Options struct {
	LocalFactory  *factory.Factory
	RemoteFactory *factory.Factory

	Timeout        time.Duration
	Wait           bool
	SkipValidation bool

	ServerGatewayType           string
	ServerTemplateName          string
	ServerTemplateNamespace     string
	ServerServiceType           *argsutils.StringEnum
	ServerServicePort           int32
	ServerServiceNodePort       int32
	ServerServiceLoadBalancerIP string

	ClientGatewayType       string
	ClientTemplateName      string
	ClientTemplateNamespace string
	// ClientConnectAddress is the address used by the client to connect to the gateway server. When this value is specified
	// liqoctl ignores the values of server and port written in the GatewayServer status.
	ClientConnectAddress string
	// ClientConnectPort is the port used by the client to connect to the gateway server. When this value is specified
	// liqoctl ignores the values of server and port written in the GatewayServer status.
	ClientConnectPort int32

	MTU                int
	DisableSharingKeys bool
}

Options encapsulates the arguments of the network command.

func NewOptions

func NewOptions(localFactory *factory.Factory) *Options

NewOptions returns a new Options struct.

func (*Options) RunConnect

func (o *Options) RunConnect(ctx context.Context) error

RunConnect connect two clusters using liqo networking.

func (*Options) RunDisconnect

func (o *Options) RunDisconnect(ctx context.Context, cluster1, cluster2 *Cluster) error

RunDisconnect disconnects two clusters. It deletes the gateways (if present) on both clusters. Cluster1 and Cluster2 are optional, if not provided they will be created and initialized.

func (*Options) RunReset

func (o *Options) RunReset(ctx context.Context) error

RunReset reset the liqo networking between two clusters. If the clusters are still connected through the gateways, it deletes them before removing network Configurations.

Jump to

Keyboard shortcuts

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