kind

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: Apache-2.0 Imports: 30 Imported by: 1

Documentation

Overview

Package kind implements the runtime.Runtime interface using the kind.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildKind

func BuildKind(conf BuildKindConfig) (string, error)

BuildKind builds the kind yaml content.

func BuildKwokControllerPod added in v0.1.0

func BuildKwokControllerPod(conf BuildKwokControllerPodConfig) (string, error)

BuildKwokControllerPod builds the kwok controller pod yaml content.

func BuildPrometheusDeployment

func BuildPrometheusDeployment(conf BuildPrometheusDeploymentConfig) (string, error)

BuildPrometheusDeployment builds the prometheus deployment yaml content.

func NewDockerCluster added in v0.3.0

func NewDockerCluster(name, workdir string) (runtime.Runtime, error)

NewDockerCluster creates a new Runtime for kind with docker

func NewPodmanCluster added in v0.3.0

func NewPodmanCluster(name, workdir string) (runtime.Runtime, error)

NewPodmanCluster creates a new Runtime for kind with podman

Types

type BuildKindConfig

type BuildKindConfig struct {
	KubeApiserverPort  uint32
	EtcdPort           uint32
	PrometheusPort     uint32
	KwokControllerPort uint32

	RuntimeConfig []string
	FeatureGates  []string

	AuditPolicy string
	AuditLog    string

	KubeconfigPath  string
	SchedulerConfig string
	ConfigPath      string

	EtcdExtraArgs                 []internalversion.ExtraArgs
	EtcdExtraVolumes              []internalversion.Volume
	ApiserverExtraArgs            []internalversion.ExtraArgs
	ApiserverExtraVolumes         []internalversion.Volume
	SchedulerExtraArgs            []internalversion.ExtraArgs
	SchedulerExtraVolumes         []internalversion.Volume
	ControllerManagerExtraArgs    []internalversion.ExtraArgs
	Verbosity                     log.Level
	ControllerManagerExtraVolumes []internalversion.Volume
	KwokControllerExtraVolumes    []internalversion.Volume

	BindAddress      string
	DisableQPSLimits bool
	KubeVersion      version.Version
}

BuildKindConfig is the configuration for building the kind config

type BuildKwokControllerPodConfig added in v0.1.0

type BuildKwokControllerPodConfig struct {
	KwokControllerImage      string
	KwokControllerImageName  string
	KwokControllerImageTag   string
	Name                     string
	Verbosity                log.Level
	NodeLeaseDurationSeconds uint
	ExtraArgs                []internalversion.ExtraArgs
	ExtraVolumes             []internalversion.Volume
}

BuildKwokControllerPodConfig is the configuration for building the kwok controller pod

type BuildPrometheusDeploymentConfig

type BuildPrometheusDeploymentConfig struct {
	PrometheusImage string
	Name            string
	LogLevel        string
	ExtraArgs       []internalversion.ExtraArgs
	ExtraVolumes    []internalversion.Volume
	Metrics         []*internalversion.Metric
}

BuildPrometheusDeploymentConfig is the configuration for building the prometheus deployment

type Cluster

type Cluster struct {
	*runtime.Cluster
	// contains filtered or unexported fields
}

Cluster is an implementation of Runtime for kind

func (*Cluster) AddContext added in v0.2.0

func (c *Cluster) AddContext(ctx context.Context, kubeconfigPath string) error

AddContext add the context of cluster to kubeconfig

func (*Cluster) Available added in v0.2.0

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

Available checks whether the runtime is available.

func (*Cluster) CollectLogs added in v0.3.0

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

CollectLogs returns the logs of the specified component.

func (*Cluster) Down

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

Down stops the cluster

func (*Cluster) EtcdctlInCluster added in v0.1.0

func (c *Cluster) EtcdctlInCluster(ctx context.Context, args ...string) error

EtcdctlInCluster implements the ectdctl subcommand

func (*Cluster) Install

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

Install installs the cluster

func (*Cluster) ListBinaries

func (c *Cluster) ListBinaries(ctx context.Context) ([]string, error)

ListBinaries list binaries in the cluster

func (*Cluster) ListImages

func (c *Cluster) ListImages(ctx context.Context) ([]string, error)

ListImages list images in the cluster

func (*Cluster) Logs

func (c *Cluster) Logs(ctx context.Context, name string, out io.Writer) error

Logs returns the logs of the specified component.

func (*Cluster) LogsFollow

func (c *Cluster) LogsFollow(ctx context.Context, name string, out io.Writer) error

LogsFollow follows the logs of the component

func (*Cluster) Ready added in v0.1.0

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

Ready returns true if the cluster is ready

func (*Cluster) RemoveContext added in v0.2.0

func (c *Cluster) RemoveContext(ctx context.Context, kubeconfigPath string) error

RemoveContext remove the context of cluster from kubeconfig

func (*Cluster) SnapshotRestore

func (c *Cluster) SnapshotRestore(ctx context.Context, path string) error

SnapshotRestore restore the snapshot of cluster

func (*Cluster) SnapshotRestoreWithYAML added in v0.2.0

func (c *Cluster) SnapshotRestoreWithYAML(ctx context.Context, path string, filters []string) error

SnapshotRestoreWithYAML restore the snapshot of cluster

func (*Cluster) SnapshotSave

func (c *Cluster) SnapshotSave(ctx context.Context, path string) error

SnapshotSave save the snapshot of cluster

func (*Cluster) SnapshotSaveWithYAML added in v0.2.0

func (c *Cluster) SnapshotSaveWithYAML(ctx context.Context, path string, filters []string) error

SnapshotSaveWithYAML save the snapshot of cluster

func (*Cluster) Start

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

Start starts the cluster

func (*Cluster) StartComponent added in v0.1.0

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

StartComponent starts a component in the cluster

func (*Cluster) Stop

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

Stop stops the cluster

func (*Cluster) StopComponent added in v0.1.0

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

StopComponent stops a component in the cluster

func (*Cluster) Up

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

Up starts the cluster.

func (*Cluster) WaitReady added in v0.1.0

func (c *Cluster) WaitReady(ctx context.Context, timeout time.Duration) error

WaitReady waits for the cluster to be ready.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳