v1alpha3

package
v5.6.3 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

View Source
const ApiVersion = "k3d.io/v1alpha3"
View Source
const DefaultConfigTpl = `---
apiVersion: k3d.io/v1alpha3
kind: Simple
name: %s
servers: 1
agents: 0
image: %s
`

DefaultConfigTpl for printing

Variables

DefaultConfig templated DefaultConfigTpl

View Source
var JSONSchema string

JSONSchema describes the schema used to validate config files

Functions

func GetConfigByKind

func GetConfigByKind(kind string) (config.Config, error)

func MigrateV1Alpha2

func MigrateV1Alpha2(input configtypes.Config) (configtypes.Config, error)

Types

type ClusterConfig

type ClusterConfig struct {
	config.TypeMeta   `mapstructure:",squash"`
	k3d.Cluster       `mapstructure:",squash"`
	ClusterCreateOpts k3d.ClusterCreateOpts         `mapstructure:"options" json:"options"`
	KubeconfigOpts    SimpleConfigOptionsKubeconfig `mapstructure:"kubeconfig" json:"kubeconfig"`
}

ClusterConfig describes a single cluster config

func (ClusterConfig) GetAPIVersion

func (c ClusterConfig) GetAPIVersion() string

func (ClusterConfig) GetKind

func (c ClusterConfig) GetKind() string

GetKind implements Config.GetKind

type ClusterListConfig

type ClusterListConfig struct {
	config.TypeMeta `mapstructure:",squash"`
	Clusters        []k3d.Cluster `mapstructure:"clusters" json:"clusters"`
}

ClusterListConfig describes a list of clusters

func (ClusterListConfig) GetAPIVersion

func (c ClusterListConfig) GetAPIVersion() string

func (ClusterListConfig) GetKind

func (c ClusterListConfig) GetKind() string

type EnvVarWithNodeFilters

type EnvVarWithNodeFilters struct {
	EnvVar      string   `mapstructure:"envVar" json:"envVar,omitempty"`
	NodeFilters []string `mapstructure:"nodeFilters" json:"nodeFilters,omitempty"`
}

type K3sArgWithNodeFilters

type K3sArgWithNodeFilters struct {
	Arg         string   `mapstructure:"arg" json:"arg,omitempty"`
	NodeFilters []string `mapstructure:"nodeFilters" json:"nodeFilters,omitempty"`
}

type LabelWithNodeFilters

type LabelWithNodeFilters struct {
	Label       string   `mapstructure:"label" json:"label,omitempty"`
	NodeFilters []string `mapstructure:"nodeFilters" json:"nodeFilters,omitempty"`
}

type PortWithNodeFilters

type PortWithNodeFilters struct {
	Port        string   `mapstructure:"port" json:"port,omitempty"`
	NodeFilters []string `mapstructure:"nodeFilters" json:"nodeFilters,omitempty"`
}

type SimpleConfig

type SimpleConfig struct {
	config.TypeMeta `mapstructure:",squash"`
	Name            string                  `mapstructure:"name" json:"name,omitempty"`
	Servers         int                     `mapstructure:"servers" json:"servers,omitempty"` //nolint:lll    // default 1
	Agents          int                     `mapstructure:"agents" json:"agents,omitempty"`   //nolint:lll    // default 0
	ExposeAPI       SimpleExposureOpts      `mapstructure:"kubeAPI" json:"kubeAPI,omitempty"`
	Image           string                  `mapstructure:"image" json:"image,omitempty"`
	Network         string                  `mapstructure:"network" json:"network,omitempty"`
	Subnet          string                  `mapstructure:"subnet" json:"subnet,omitempty"`
	ClusterToken    string                  `mapstructure:"token" json:"clusterToken,omitempty"` // default: auto-generated
	Volumes         []VolumeWithNodeFilters `mapstructure:"volumes" json:"volumes,omitempty"`
	Ports           []PortWithNodeFilters   `mapstructure:"ports" json:"ports,omitempty"`
	Options         SimpleConfigOptions     `mapstructure:"options" json:"options,omitempty"`
	Env             []EnvVarWithNodeFilters `mapstructure:"env" json:"env,omitempty"`
	Registries      SimpleConfigRegistries  `mapstructure:"registries" json:"registries,omitempty"`
}

SimpleConfig describes the toplevel k3d configuration file.

func (SimpleConfig) GetAPIVersion

func (c SimpleConfig) GetAPIVersion() string

func (SimpleConfig) GetKind

func (c SimpleConfig) GetKind() string

GetKind implements Config.GetKind

type SimpleConfigIntermediateV1alpha2

type SimpleConfigIntermediateV1alpha2 struct {
	config.TypeMeta `mapstructure:",squash"`
	Name            string                                     `mapstructure:"name" json:"name,omitempty"`
	Servers         int                                        `mapstructure:"servers" json:"servers,omitempty"` //nolint:lll    // default 1
	Agents          int                                        `mapstructure:"agents" json:"agents,omitempty"`   //nolint:lll    // default 0
	ExposeAPI       SimpleExposureOpts                         `mapstructure:"kubeAPI" json:"kubeAPI,omitempty"`
	Image           string                                     `mapstructure:"image" json:"image,omitempty"`
	Network         string                                     `mapstructure:"network" json:"network,omitempty"`
	Subnet          string                                     `mapstructure:"subnet" json:"subnet,omitempty"`
	ClusterToken    string                                     `mapstructure:"token" json:"clusterToken,omitempty"` // default: auto-generated
	Volumes         []VolumeWithNodeFilters                    `mapstructure:"volumes" json:"volumes,omitempty"`
	Ports           []PortWithNodeFilters                      `mapstructure:"ports" json:"ports,omitempty"`
	Options         SimpleConfigOptions                        `mapstructure:"options" json:"options,omitempty"`
	Env             []EnvVarWithNodeFilters                    `mapstructure:"env" json:"env,omitempty"`
	Registries      SimpleConfigRegistriesIntermediateV1alpha2 `mapstructure:"registries" json:"registries,omitempty"`
}

type SimpleConfigOptions

type SimpleConfigOptions struct {
	K3dOptions        SimpleConfigOptionsK3d        `mapstructure:"k3d" json:"k3d"`
	K3sOptions        SimpleConfigOptionsK3s        `mapstructure:"k3s" json:"k3s"`
	KubeconfigOptions SimpleConfigOptionsKubeconfig `mapstructure:"kubeconfig" json:"kubeconfig"`
	Runtime           SimpleConfigOptionsRuntime    `mapstructure:"runtime" json:"runtime"`
}

type SimpleConfigOptionsK3d

type SimpleConfigOptionsK3d struct {
	Wait                bool                               `mapstructure:"wait" json:"wait"`
	Timeout             time.Duration                      `mapstructure:"timeout" json:"timeout,omitempty"`
	DisableLoadbalancer bool                               `mapstructure:"disableLoadbalancer" json:"disableLoadbalancer"`
	DisableImageVolume  bool                               `mapstructure:"disableImageVolume" json:"disableImageVolume"`
	NoRollback          bool                               `mapstructure:"disableRollback" json:"disableRollback"`
	NodeHookActions     []k3d.NodeHookAction               `mapstructure:"nodeHookActions" json:"nodeHookActions,omitempty"`
	Loadbalancer        SimpleConfigOptionsK3dLoadbalancer `mapstructure:"loadbalancer" json:"loadbalancer,omitempty"`
}

type SimpleConfigOptionsK3dLoadbalancer

type SimpleConfigOptionsK3dLoadbalancer struct {
	ConfigOverrides []string `mapstructure:"configOverrides" json:"configOverrides,omitempty"`
}

type SimpleConfigOptionsK3s

type SimpleConfigOptionsK3s struct {
	ExtraArgs  []K3sArgWithNodeFilters `mapstructure:"extraArgs" json:"extraArgs,omitempty"`
	NodeLabels []LabelWithNodeFilters  `mapstructure:"nodeLabels" json:"nodeLabels,omitempty"`
}

type SimpleConfigOptionsKubeconfig

type SimpleConfigOptionsKubeconfig struct {
	UpdateDefaultKubeconfig bool `mapstructure:"updateDefaultKubeconfig" json:"updateDefaultKubeconfig,omitempty"` // default: true
	SwitchCurrentContext    bool `mapstructure:"switchCurrentContext" json:"switchCurrentContext,omitempty"`       //nolint:lll    // default: true
}

SimpleConfigOptionsKubeconfig describes the set of options referring to the kubeconfig during cluster creation.

type SimpleConfigOptionsRuntime

type SimpleConfigOptionsRuntime struct {
	GPURequest    string                 `mapstructure:"gpuRequest" json:"gpuRequest,omitempty"`
	ServersMemory string                 `mapstructure:"serversMemory" json:"serversMemory,omitempty"`
	AgentsMemory  string                 `mapstructure:"agentsMemory" json:"agentsMemory,omitempty"`
	Labels        []LabelWithNodeFilters `mapstructure:"labels" json:"labels,omitempty"`
}

type SimpleConfigRegistries

type SimpleConfigRegistries struct {
	Use    []string                          `mapstructure:"use" json:"use,omitempty"`
	Create *SimpleConfigRegistryCreateConfig `mapstructure:"create" json:"create,omitempty"`
	Config string                            `mapstructure:"config" json:"config,omitempty"` // registries.yaml (k3s config for containerd registry override)
}

type SimpleConfigRegistriesIntermediateV1alpha2

type SimpleConfigRegistriesIntermediateV1alpha2 struct {
	Use []string `mapstructure:"use" json:"use,omitempty"`
	// Field "Create" changed significantly, so it's dropped here
	Config string `mapstructure:"config" json:"config,omitempty"` // registries.yaml (k3s config for containerd registry override)
}

type SimpleConfigRegistryCreateConfig

type SimpleConfigRegistryCreateConfig struct {
	Name     string `mapstructure:"name" json:"name,omitempty"`
	Host     string `mapstructure:"host" json:"host,omitempty"`
	HostPort string `mapstructure:"hostPort" json:"hostPort,omitempty"`
}

type SimpleExposureOpts

type SimpleExposureOpts struct {
	Host     string `mapstructure:"host" json:"host,omitempty"`
	HostIP   string `mapstructure:"hostIP" json:"hostIP,omitempty"`
	HostPort string `mapstructure:"hostPort" json:"hostPort,omitempty"`
}

SimpleExposureOpts provides a simplified syntax compared to the original k3d.ExposureOpts

type VolumeWithNodeFilters

type VolumeWithNodeFilters struct {
	Volume      string   `mapstructure:"volume" json:"volume,omitempty"`
	NodeFilters []string `mapstructure:"nodeFilters" json:"nodeFilters,omitempty"`
}

Jump to

Keyboard shortcuts

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