network

package
v0.11.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: Apache-2.0 Imports: 25 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 {
	Waiter *wait.Waiter
	// contains filtered or unexported fields
}

Cluster contains the information about a cluster.

func NewCluster

func NewCluster(local, remote *factory.Factory) *Cluster

NewCluster returns a new Cluster struct.

func (*Cluster) CheckNetworkInitialized

func (c *Cluster) CheckNetworkInitialized(ctx context.Context, remoteClusterIdentity *discoveryv1alpha1.ClusterIdentity) 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 *gatewayclient.ForgeOptions) (*networkingv1alpha1.GatewayClient, error)

EnsureGatewayClient create or updates a GatewayClient.

func (*Cluster) EnsureGatewayServer

func (c *Cluster) EnsureGatewayServer(ctx context.Context, name string, opts *gatewayserver.ForgeOptions) (*networkingv1alpha1.GatewayServer, error)

EnsureGatewayServer create or updates a GatewayServer.

func (*Cluster) EnsurePublicKey

func (c *Cluster) EnsurePublicKey(ctx context.Context, remoteClusterIdentity *discoveryv1alpha1.ClusterIdentity,
	key []byte, ownerGateway metav1.Object) error

EnsurePublicKey create or updates a PublicKey.

func (*Cluster) GetGatewayClient

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

GetGatewayClient retrieves a GatewayClient.

func (*Cluster) GetGatewayServer

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

GetGatewayServer retrieves a GatewayServer.

func (*Cluster) Init

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

Init initializes the cluster struct.

func (*Cluster) SetClusterIdentity

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

SetClusterIdentity set cluster identities of both local and remote clusters 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) error

SetNamespaces sets the local and remote namespaces to the liqo-tenants namespaces (creating them if necessary), 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 *networkingv1alpha1.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
	Proxy              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) error

RunDisconnect disconnects two clusters.

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.

Jump to

Keyboard shortcuts

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