Documentation ¶
Index ¶
Constants ¶
View Source
const ( APIVersion = "v1alpha1" DefaultClusterName = "k3smanager" DefaultNetworkCIDR = "10.0.0.0/16" DefaultSSHPort = 22 GlobalCIDR = "0.0.0.0/0" GlobalCIDRv6 = "::/0" )
Variables ¶
View Source
var ErrInvalidAPIVersion = errors.New("invalid api version")
Functions ¶
func ValidateAPIVersion ¶
Ensure the API version is valid - this doesn't really do anything at the moment, but exists for future-proofing
func ValidateTaintEffect ¶
func ValidateTaintEffect(fl validator.FieldLevel) bool
Types ¶
type Cluster ¶
type Cluster struct { Name string `json:"name,omitempty" env:"NAME" validate:"required"` ManagerPool ClusterNodePool `json:"managerPool" envPrefix:"MANAGER_POOL_" validate:"required"` // @todo(sje): envPrefix not yet supported for slices // @link https://github.com/caarlos0/env/issues/298 WorkerPools []ClusterNodePool `json:"workerPools" validate:"dive,required"` }
type ClusterNodePool ¶
type ClusterNodePool struct { Name string `json:"name" env:"NAME" validate:"required"` Count int `json:"count" env:"COUNT" validate:"required,gt=0"` Labels []NodeLabel `json:"labels,omitempty" validate:"dive,required"` Taints []NodeTaint `json:"taints,omitempty" validate:"dive,required"` // All of these values are provider-specific Type string `json:"type" env:"TYPE" validate:"required"` Location string `json:"location" env:"LOCATION" validate:"required"` Image *string `json:"image,omitempty" env:"IMAGE"` // If not specified, this will use the default as-specified by the provider Arch *string `json:"arch,omitempty" env:"ARCH"` // If not specified, this will use the default as-specified by the provider }
type Config ¶
type Config struct { APIVersion string `json:"apiVersion" validate:"required"` Cluster `json:"cluster" envPrefix:"CLUSTER_"` K3s `json:"k3s" envPrefix:"K3S_"` Networking `json:"networking" envPrefix:"NETWORKING_"` Provider `json:"provider" envPrefix:"PROVIDER_"` }
type K3s ¶
type K3s struct { Datastore K3sDatastore `json:"datastore" envPrefix:"K3S_DATASTORE_" validate:"required"` Version string `json:"version,omitempty" env:"VERSION"` // If empty, uses the latest }
type K3sDatastore ¶
type K3sDatastore struct { Type K3sDatastoreType `json:"type" env:"TYPE" validate:"required"` Endpoint string `json:"endpoint,omitempty" env:"ENDPOINT" validate:"required_if=Type external"` }
type K3sDatastoreType ¶
type K3sDatastoreType string
const ( K3S_DATASTORE_TYPE_ETCD K3sDatastoreType = "etcd" K3S_DATASTORE_TYPE_EXTERNAL K3sDatastoreType = "external" )
type Networking ¶
type Networking struct { NetworkingAllowed `json:"allowed" envPrefix:"ALLOWED_"` Location string `json:"location" env:"LOCATION" validate:"required"` SSHPort int `json:"sshPort" env:"SSH_PORT" validate:"required,numeric"` Subnet string `json:"subnet" env:"SUBNET" validate:"required,cidr"` }
type NetworkingAllowed ¶
Click to show internal directories.
Click to hide internal directories.