k3d

package
v0.0.336-dev Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	IgnoreZfsCheck     = false
	IgnoreVersionCheck = false
)
View Source
var Pins = map[string]artifacts.Reference{
	"linux/amd64": {
		URL: fmt.Sprintf("https://github.com/rancher/k3d/releases/download/v%s/k3d-linux-amd64", version),
		Digest: schema.Digest{
			Algorithm: "sha256",
			Hex:       "7ddb900e6e50120b65d61568f6af007a82331bf83918608a6a7be8910792faef",
		},
	},
	"linux/arm64": {
		URL: fmt.Sprintf("https://github.com/rancher/k3d/releases/download/v%s/k3d-linux-arm64", version),
		Digest: schema.Digest{
			Algorithm: "sha256",
			Hex:       "ccf1dafc1eddfef083375377a52ef0ca269a41c5bc4f0f4d7e11a7c56da08833",
		},
	},
	"darwin/arm64": {
		URL: fmt.Sprintf("https://github.com/rancher/k3d/releases/download/v%s/k3d-darwin-arm64", version),
		Digest: schema.Digest{
			Algorithm: "sha256",
			Hex:       "d0149ecb9b3fb831d617a0a880d8235722a70b9131f45f1389235e586050f8f9",
		},
	},
	"darwin/amd64": {
		URL: fmt.Sprintf("https://github.com/rancher/k3d/releases/download/v%s/k3d-darwin-amd64", version),
		Digest: schema.Digest{
			Algorithm: "sha256",
			Hex:       "40ac312bc762611de80daff24cb66d79aaaf17bf90e5e8d61caf90e63b57542d",
		},
	},
}

Functions

func ValidateDocker

func ValidateDocker(ctx context.Context, cli docker.Client) error

Types

type Cluster

type Cluster struct {
	Name  string `json:"name,omitempty"`
	Nodes []Node `json:"nodes,omitempty"`
}

type K3D

type K3D string

func EnsureSDK

func EnsureSDK(ctx context.Context, p specs.Platform) (K3D, error)

func (K3D) CreateCluster

func (k3d K3D) CreateCluster(ctx context.Context, name, registry, image string, updateDefault bool) error

func (K3D) CreateRegistry

func (k3d K3D) CreateRegistry(ctx context.Context, name string, port int) error

If port is 0, an open port is allocated dynamically.

func (K3D) DeleteCluster

func (k3d K3D) DeleteCluster(ctx context.Context, name string) error

func (K3D) DeleteRegistry

func (k3d K3D) DeleteRegistry(ctx context.Context, name string) error

func (K3D) ListClusters

func (k3d K3D) ListClusters(ctx context.Context) ([]Cluster, error)

func (K3D) ListRegistries

func (k3d K3D) ListRegistries(ctx context.Context) ([]Registry, error)

func (K3D) MergeConfiguration

func (k3d K3D) MergeConfiguration(ctx context.Context, name string) error

func (K3D) StartNode

func (k3d K3D) StartNode(ctx context.Context, nodeName string) error

func (K3D) StopNode

func (k3d K3D) StopNode(ctx context.Context, nodeName string) error

type Node

type Node struct {
	Name  string `json:"name,omitempty"`
	Role  string `json:"role,omitempty"`
	State State  `json:"state,omitempty"`
}

type Registry

type Registry = Node

type State

type State struct {
	Running bool   `json:"running,omitempty"`
	Status  string `json:"status,omitempty"`
}

Jump to

Keyboard shortcuts

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