pkg

package
v0.121.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 45 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ComponentCluster  = "cluster"
	ComponentRegistry = "registry"
)
View Source
const (
	DNSFormatInternal = "internal"
	DNSFormatExternal = "external"
)
View Source
const ClusterIdLabelName = "cluster.test.landscaper.gardener.cloud/id"

ClusterIdLabelName is the name of the label that holds the unique id for the current created cluster. It is used by the delete command to find the created cluster.

View Source
const ComponentLabelName = "cluster.test.landscaper.gardener.cloud/component"

ComponentLabelName is the name of the label that specifies the component that is deployed

View Source
const DefaultK8sVersion = "v1.20.8"

DefaultK8sVersion defines the default k3s version. The real version is appended with a "-k3s1"

View Source
const K3sImageRepository = "docker.io/rancher/k3s"

K3sImageRepository is the repository name of the k3s images.

Variables

This section is empty.

Functions

func CreateCluster

func CreateCluster(ctx context.Context, logger utils.Logger, args CreateClusterArgs) (err error)

CreateCluster creates a new k3d cluster running in a pod.

func CreateHtpasswd

func CreateHtpasswd(username, password string) string

CreateHtpasswd creates a htpasswd string for a username and password

func CreateRegistry

func CreateRegistry(ctx context.Context,
	logger utils.Logger,
	kubeClient client.Client,
	restConfig *rest.Config,
	namespace string,
	id string,
	stateFile string,
	password string,
	dnsFormat string,
	exportRegistryCreds string,
	timeout time.Duration,
	runOnShoot bool) (err error)

func DeleteCluster

func DeleteCluster(ctx context.Context,
	logger utils.Logger,
	kubeClient client.Client,
	namespace string,
	id string,
	timeout time.Duration) error

DeleteCluster deletes a previously deployed test cluster.

func DeleteRegistry

func DeleteRegistry(ctx context.Context,
	logger utils.Logger,
	kubeClient client.Client,
	namespace string,
	id string,
	timeout time.Duration) error

DeleteRegistry deletes a previously created registry.

func RandString

func RandString(n int) string

RandString creates a random string with n characters.

Types

type CreateClusterArgs

type CreateClusterArgs struct {
	KubeClient           client.Client
	RestConfig           *rest.Config
	Namespace            string
	ID                   string
	StateFile            string
	ExportKubeconfigPath string
	Timeout              time.Duration
	KubernetesVersion    string
}

CreateClusterArgs defines the arguments to create a cluster.

type ShootClusterManager

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

func NewShootClusterManager

func NewShootClusterManager(log utils.Logger, gardenClusterKubeconfigPath, namespace,
	authDirectoryPath string, maxNumOfClusters, numClustersStartDeleteOldest int, durationForClusterDeletion,
	prID string, nginxIngressEnabled, disableShootDeletion, workerless bool) (*ShootClusterManager, error)

func (*ShootClusterManager) CreateShootCluster

func (o *ShootClusterManager) CreateShootCluster(ctx context.Context) error

func (*ShootClusterManager) DeleteShootCluster

func (o *ShootClusterManager) DeleteShootCluster(ctx context.Context) error

type State

type State struct {
	ID string `json:"id"`
}

State defines the content of the state file that is written by the create command and consumed by the delete command.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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