network

package
v1.0.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: Apache-2.0 Imports: 24 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.

func (*Cluster) DeleteConfiguration

func (c *Cluster) DeleteConfiguration(ctx context.Context, name string) error

DeleteConfiguration deletes a Configuration.

func (*Cluster) DeleteGatewayClient

func (c *Cluster) DeleteGatewayClient(ctx context.Context, name string) error

DeleteGatewayClient deletes a GatewayClient.

func (*Cluster) DeleteGatewayServer

func (c *Cluster) DeleteGatewayServer(ctx context.Context, name string) error

DeleteGatewayServer deletes a GatewayServer.

func (*Cluster) EnsureGatewayClient

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

EnsureGatewayClient create or updates a GatewayClient.

func (*Cluster) EnsureGatewayServer

func (c *Cluster) EnsureGatewayServer(ctx context.Context, name string, 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) GetGatewayClient

func (c *Cluster) GetGatewayClient(ctx context.Context, name string) (*networkingv1beta1.GatewayClient, error)

GetGatewayClient retrieves a GatewayClient.

func (*Cluster) GetGatewayServer

func (c *Cluster) GetGatewayServer(ctx context.Context, name string) (*networkingv1beta1.GatewayServer, error)

GetGatewayServer retrieves a GatewayServer.

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

	ServerGatewayType       string
	ServerTemplateName      string
	ServerTemplateNamespace string
	ServerServiceType       *argsutils.StringEnum
	ServerPort              int32
	ServerNodePort          int32
	ServerLoadBalancerIP    string

	ClientGatewayType       string
	ClientTemplateName      string
	ClientTemplateNamespace string

	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) RunInit

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

RunInit initializes the liqo networking between two clusters.

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