Documentation
¶
Index ¶
- Constants
- Variables
- func GetConfigByKind(kind string) (config.Config, error)
- func MigrateV1Alpha2(input configtypes.Config) (configtypes.Config, error)
- func MigrateV1Alpha3(input configtypes.Config) (configtypes.Config, error)
- type ClusterConfig
- type ClusterListConfig
- type EnvVarWithNodeFilters
- type K3sArgWithNodeFilters
- type LabelWithNodeFilters
- type PortWithNodeFilters
- type SimpleConfig
- type SimpleConfigOptions
- type SimpleConfigOptionsK3d
- type SimpleConfigOptionsK3dLoadbalancer
- type SimpleConfigOptionsK3s
- type SimpleConfigOptionsKubeconfig
- type SimpleConfigOptionsRuntime
- type SimpleConfigRegistries
- type SimpleConfigRegistryCreateConfig
- type SimpleExposureOpts
- type VolumeWithNodeFilters
Constants ¶
View Source
const ApiVersion = "k3d.io/v1alpha4"
View Source
const DefaultConfigTpl = `---
apiVersion: k3d.io/v1alpha4
kind: Simple
name: %s
servers: 1
agents: 0
image: %s
`
DefaultConfigTpl for printing
Variables ¶
View Source
var DefaultConfig = fmt.Sprintf( DefaultConfigTpl, k3d.DefaultClusterName, fmt.Sprintf("%s:%s", k3d.DefaultK3sImageRepo, version.K3sVersion), )
DefaultConfig templated DefaultConfigTpl
View Source
var JSONSchema string
JSONSchema describes the schema used to validate config files
View Source
var Migrations = map[string]func(configtypes.Config) (configtypes.Config, error){ v1alpha2.ApiVersion: MigrateV1Alpha2, v1alpha3.ApiVersion: MigrateV1Alpha3, }
Functions ¶
func MigrateV1Alpha2 ¶
func MigrateV1Alpha2(input configtypes.Config) (configtypes.Config, error)
func MigrateV1Alpha3 ¶
func MigrateV1Alpha3(input configtypes.Config) (configtypes.Config, error)
Types ¶
type ClusterConfig ¶
type ClusterConfig struct { config.TypeMeta `mapstructure:",squash" yaml:",inline"` Cluster k3d.Cluster `mapstructure:",squash" yaml:",inline"` ClusterCreateOpts k3d.ClusterCreateOpts `mapstructure:"options" yaml:"options"` KubeconfigOpts SimpleConfigOptionsKubeconfig `mapstructure:"kubeconfig" yaml:"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" yaml:",inline"` Clusters []k3d.Cluster `mapstructure:"clusters" yaml:"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 K3sArgWithNodeFilters ¶
type LabelWithNodeFilters ¶
type PortWithNodeFilters ¶
type SimpleConfig ¶
type SimpleConfig struct { config.TypeMeta `mapstructure:",squash" yaml:",inline"` config.ObjectMeta `mapstructure:"metadata" yaml:"metadata,omitempty" json:"metadata,omitempty"` Servers int `mapstructure:"servers" yaml:"servers,omitempty" json:"servers,omitempty"` //nolint:lll // default 1 Agents int `mapstructure:"agents" yaml:"agents,omitempty" json:"agents,omitempty"` //nolint:lll // default 0 ExposeAPI SimpleExposureOpts `mapstructure:"kubeAPI" yaml:"kubeAPI,omitempty" json:"kubeAPI,omitempty"` Image string `mapstructure:"image" yaml:"image,omitempty" json:"image,omitempty"` Network string `mapstructure:"network" yaml:"network,omitempty" json:"network,omitempty"` Subnet string `mapstructure:"subnet" yaml:"subnet,omitempty" json:"subnet,omitempty"` ClusterToken string `mapstructure:"token" yaml:"clusterToken,omitempty" json:"clusterToken,omitempty"` // default: auto-generated Volumes []VolumeWithNodeFilters `mapstructure:"volumes" yaml:"volumes,omitempty" json:"volumes,omitempty"` Ports []PortWithNodeFilters `mapstructure:"ports" yaml:"ports,omitempty" json:"ports,omitempty"` Options SimpleConfigOptions `mapstructure:"options" yaml:"options,omitempty" json:"options,omitempty"` Env []EnvVarWithNodeFilters `mapstructure:"env" yaml:"env,omitempty" json:"env,omitempty"` Registries SimpleConfigRegistries `mapstructure:"registries" yaml:"registries,omitempty" json:"registries,omitempty"` HostAliases []k3d.HostAlias `mapstructure:"hostAliases" yaml:"hostAliases,omitempty" json:"hostAliases,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 SimpleConfigOptions ¶
type SimpleConfigOptions struct { K3dOptions SimpleConfigOptionsK3d `mapstructure:"k3d" yaml:"k3d" json:"k3d"` K3sOptions SimpleConfigOptionsK3s `mapstructure:"k3s" yaml:"k3s" json:"k3s"` KubeconfigOptions SimpleConfigOptionsKubeconfig `mapstructure:"kubeconfig" yaml:"kubeconfig" json:"kubeconfig"` Runtime SimpleConfigOptionsRuntime `mapstructure:"runtime" yaml:"runtime" json:"runtime"` }
type SimpleConfigOptionsK3d ¶
type SimpleConfigOptionsK3d struct { Wait bool `mapstructure:"wait" yaml:"wait" json:"wait"` Timeout time.Duration `mapstructure:"timeout" yaml:"timeout,omitempty" json:"timeout,omitempty"` DisableLoadbalancer bool `mapstructure:"disableLoadbalancer" yaml:"disableLoadbalancer" json:"disableLoadbalancer"` DisableImageVolume bool `mapstructure:"disableImageVolume" yaml:"disableImageVolume" json:"disableImageVolume"` NoRollback bool `mapstructure:"disableRollback" yaml:"disableRollback" json:"disableRollback"` NodeHookActions []k3d.NodeHookAction `mapstructure:"nodeHookActions" yaml:"nodeHookActions,omitempty" json:"nodeHookActions,omitempty"` Loadbalancer SimpleConfigOptionsK3dLoadbalancer `mapstructure:"loadbalancer" yaml:"loadbalancer,omitempty" json:"loadbalancer,omitempty"` }
type SimpleConfigOptionsK3dLoadbalancer ¶
type SimpleConfigOptionsK3dLoadbalancer struct {
ConfigOverrides []string `mapstructure:"configOverrides" yaml:"configOverrides,omitempty" json:"configOverrides,omitempty"`
}
type SimpleConfigOptionsK3s ¶
type SimpleConfigOptionsK3s struct { ExtraArgs []K3sArgWithNodeFilters `mapstructure:"extraArgs" yaml:"extraArgs,omitempty" json:"extraArgs,omitempty"` NodeLabels []LabelWithNodeFilters `mapstructure:"nodeLabels" yaml:"nodeLabels,omitempty" json:"nodeLabels,omitempty"` }
type SimpleConfigOptionsKubeconfig ¶
type SimpleConfigOptionsKubeconfig struct { UpdateDefaultKubeconfig bool `mapstructure:"updateDefaultKubeconfig" yaml:"updateDefaultKubeconfig" json:"updateDefaultKubeconfig,omitempty"` // default: true SwitchCurrentContext bool `mapstructure:"switchCurrentContext" yaml:"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" yaml:"gpuRequest,omitempty" json:"gpuRequest,omitempty"` ServersMemory string `mapstructure:"serversMemory" yaml:"serversMemory,omitempty" json:"serversMemory,omitempty"` AgentsMemory string `mapstructure:"agentsMemory" yaml:"agentsMemory,omitempty" json:"agentsMemory,omitempty"` HostPidMode bool `mapstructure:"hostPidMode" yaml:"hostPidMode,omitempty" json:"hostPidMode,omitempty"` Labels []LabelWithNodeFilters `mapstructure:"labels" yaml:"labels,omitempty" json:"labels,omitempty"` }
type SimpleConfigRegistries ¶
type SimpleConfigRegistries struct { Use []string `mapstructure:"use" yaml:"use,omitempty" json:"use,omitempty"` Create *SimpleConfigRegistryCreateConfig `mapstructure:"create" yaml:"create,omitempty" json:"create,omitempty"` Config string `mapstructure:"config" yaml:"config,omitempty" json:"config,omitempty"` // registries.yaml (k3s config for containerd registry override) }
type SimpleExposureOpts ¶
type SimpleExposureOpts struct { Host string `mapstructure:"host" yaml:"host,omitempty" json:"host,omitempty"` HostIP string `mapstructure:"hostIP" yaml:"hostIP,omitempty" json:"hostIP,omitempty"` HostPort string `mapstructure:"hostPort" yaml:"hostPort,omitempty" json:"hostPort,omitempty"` }
SimpleExposureOpts provides a simplified syntax compared to the original k3d.ExposureOpts
type VolumeWithNodeFilters ¶
Click to show internal directories.
Click to hide internal directories.