v1alpha1

package
v0.6.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2020 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package v1alpha1 configuration file contains all the options available for configuring a machine.

We can generate the files using `talosctl`. This configuration is enough to get started in most cases, however it can be customized as needed.

```bash talosctl config generate --version v1alpha1 <cluster name> <cluster endpoint> ````

This will generate a machine config for each node type, and a talosconfig. The following is an example of an `init.yaml`:

```yaml version: v1alpha1 machine:

type: init
token: 5dt69c.npg6duv71zwqhzbg
ca:
  crt: <base64 encoded Ed25519 certificate>
  key: <base64 encoded Ed25519 key>
certSANs: []
kubelet: {}
network: {}
install:
  disk: /dev/sda
  image: docker.io/autonomy/installer:latest
  bootloader: true
  wipe: false
  force: false

cluster:

controlPlane:
  version: 1.18.0
  endpoint: https://1.2.3.4
clusterName: example
network:
  cni: ""
  dnsDomain: cluster.local
  podSubnets:
  - 10.244.0.0/16
  serviceSubnets:
  - 10.96.0.0/12
token: wlzjyw.bei2zfylhs2by0wd
certificateKey: 20d9aafb46d6db4c0958db5b3fc481c8c14fc9b1abd8ac43194f4246b77131be
aescbcEncryptionSecret: z01mye6j16bspJYtTB/5SFX8j7Ph4JXxM2Xuu4vsBPM=
ca:
  crt: <base64 encoded RSA certificate>
  key: <base64 encoded RSA key>
apiServer: {}
controllerManager: {}
scheduler: {}
etcd:
  ca:
    crt: <base64 encoded RSA certificate>
    key: <base64 encoded RSA key>

```

Package v1alpha1 provides user-facing v1alpha1 machine configs nolint: dupl

Index

Constants

View Source
const (
	// Version is the version string for v1alpha1.
	Version = "v1alpha1"
)

Variables

View Source
var (

	// ErrRequiredSection denotes a section is required
	ErrRequiredSection = errors.New("required config section")
	// ErrInvalidVersion denotes that the config file version is invalid
	ErrInvalidVersion = errors.New("invalid config version")

	// ErrInvalidCert denotes that the certificate specified is invalid
	ErrInvalidCert = errors.New("certificate is invalid")
	// ErrInvalidCertType denotes that the certificate type is invalid
	ErrInvalidCertType = errors.New("certificate type is invalid")

	// ErrUnsupportedCNI denotes that the specified CNI is invalid
	ErrUnsupportedCNI = errors.New("unsupported CNI driver")
	// ErrInvalidTrustdToken denotes that a trustd token has not been specified
	ErrInvalidTrustdToken = errors.New("trustd token is invalid")

	// ErrBadAddressing denotes that an incorrect combination of network
	// address methods have been specified
	ErrBadAddressing = errors.New("invalid network device addressing method")
	// ErrInvalidAddress denotes that a bad address was provided
	ErrInvalidAddress = errors.New("invalid network address")
)

Functions

func CheckDeviceAddressing

func CheckDeviceAddressing(d runtime.Device) error

CheckDeviceAddressing ensures that an appropriate addressing method. has been specified nolint: dupl

func CheckDeviceInterface

func CheckDeviceInterface(d runtime.Device) error

CheckDeviceInterface ensures that the interface has been specified. nolint: dupl

func CheckDeviceRoutes

func CheckDeviceRoutes(d runtime.Device) error

CheckDeviceRoutes ensures that the specified routes are valid. nolint: dupl

func ValidateNetworkDevices

func ValidateNetworkDevices(d runtime.Device, checks ...NetworkDeviceCheck) error

ValidateNetworkDevices runs the specified validation checks specific to the network devices. nolint: dupl

Types

type APIServerConfig

type APIServerConfig struct {
	//   description: |
	//     The container image used in the API server manifest.
	Image string `yaml:"image,omitempty"`
	//   description: |
	//     Extra arguments to supply to the API server.
	ExtraArgsConfig map[string]string `yaml:"extraArgs,omitempty"`
	//   description: |
	//     Extra certificate subject alternative names for the API server's certificate.
	CertSANs []string `yaml:"certSANs,omitempty"`
}

APIServerConfig represents kube apiserver config vals.

func (*APIServerConfig) ExtraArgs

func (a *APIServerConfig) ExtraArgs() map[string]string

ExtraArgs implements the Configurator interface.

type AdminKubeconfigConfig added in v0.4.0

type AdminKubeconfigConfig struct {
	//   description: |
	//     Admin kubeconfig certificate lifetime (default is 1 year).
	//     Field format accepts any Go time.Duration format ('1h' for one hour, '10m' for ten minutes).
	AdminKubeconfigCertLifetime time.Duration `yaml:"certLifetime,omitempty"`
}

AdminKubeconfigConfig contains admin kubeconfig settings.

func (AdminKubeconfigConfig) CertLifetime added in v0.4.0

func (a AdminKubeconfigConfig) CertLifetime() time.Duration

CertLifetime implements the Configurator interface.

type CNIConfig

type CNIConfig struct {
	//   description: |
	//     Name of CNI to use.
	CNIName string `yaml:"name"`
	//   description: |
	//     URLs containing manifests to apply for CNI.
	CNIUrls []string `yaml:"urls,omitempty"`
}

CNIConfig contains the info about which CNI we'll deploy

func (*CNIConfig) Name

func (c *CNIConfig) Name() string

Name implements the Configurator interface.

func (*CNIConfig) URLs

func (c *CNIConfig) URLs() []string

URLs implements the Configurator interface.

type ClusterConfig

type ClusterConfig struct {
	//   description: |
	//     Provides control plane specific configuration options.
	//   examples:
	//     - |
	//       controlPlane:
	//         endpoint: https://1.2.3.4
	//         localAPIServerPort: 443
	ControlPlane *ControlPlaneConfig `yaml:"controlPlane"`
	//   description: |
	//     Configures the cluster's name.
	ClusterName string `yaml:"clusterName,omitempty"`
	//   description: |
	//     Provides cluster network configuration.
	//   examples:
	//     - |
	//       network:
	//         cni:
	//           name: flannel
	//         dnsDomain: cluster.local
	//         podSubnets:
	//         - 10.244.0.0/16
	//         serviceSubnets:
	//         - 10.96.0.0/12
	ClusterNetwork *ClusterNetworkConfig `yaml:"network,omitempty"`
	//   description: |
	//     The [bootstrap token](https://kubernetes.io/docs/reference/access-authn-authz/bootstrap-tokens/).
	//   examples:
	//     - wlzjyw.bei2zfylhs2by0wd
	BootstrapToken string `yaml:"token,omitempty"`
	//   description: |
	//     The key used for the [encryption of secret data at rest](https://kubernetes.io/docs/tasks/administer-cluster/encrypt-data/).
	//   examples:
	//     - z01mye6j16bspJYtTB/5SFX8j7Ph4JXxM2Xuu4vsBPM=
	ClusterAESCBCEncryptionSecret string `yaml:"aescbcEncryptionSecret"`
	//   description: |
	//     The base64 encoded root certificate authority used by Kubernetes.
	//   examples:
	//     - |
	//       ca:
	//         crt: LS0tLS1CRUdJTiBDRV...
	//         key: LS0tLS1CRUdJTiBSU0...
	ClusterCA *x509.PEMEncodedCertificateAndKey `yaml:"ca,omitempty"`
	//   description: |
	//     API server specific configuration options.
	//   examples:
	//     - |
	//       apiServer:
	//         image: ...
	//         extraArgs:
	//           key: value
	//         certSANs:
	//           - 1.2.3.4
	//           - 5.6.7.8
	APIServerConfig *APIServerConfig `yaml:"apiServer,omitempty"`
	//   description: |
	//     Controller manager server specific configuration options.
	//   examples:
	//     - |
	//       controllerManager:
	//         image: ...
	//         extraArgs:
	//           key: value
	ControllerManagerConfig *ControllerManagerConfig `yaml:"controllerManager,omitempty"`
	//   description: |
	//     Kube-proxy server-specific configuration options
	//   examples:
	//     - |
	//       proxy:
	//         mode: ipvs
	//         extraArgs:
	//           key: value
	ProxyConfig *ProxyConfig `yaml:"proxy,omitempty"`
	//   description: |
	//     Scheduler server specific configuration options.
	//   examples:
	//     - |
	//       scheduler:
	//         image: ...
	//         extraArgs:
	//           key: value
	SchedulerConfig *SchedulerConfig `yaml:"scheduler,omitempty"`
	//   description: |
	//     Etcd specific configuration options.
	//   examples:
	//     - |
	//       etcd:
	//         ca:
	//           crt: LS0tLS1CRUdJTiBDRV...
	//           key: LS0tLS1CRUdJTiBSU0...
	//         image: ...
	EtcdConfig *EtcdConfig `yaml:"etcd,omitempty"`
	//   description: |
	//     Pod Checkpointer specific configuration options.
	//   examples:
	//     - |
	//       podCheckpointer:
	//         image: ...
	PodCheckpointerConfig *PodCheckpointer `yaml:"podCheckpointer,omitempty"`
	//   description: |
	//     Core DNS specific configuration options.
	//   examples:
	//     - |
	//       coreDNS:
	//         image: ...
	CoreDNSConfig *CoreDNS `yaml:"coreDNS,omitempty"`
	//   description: |
	//     A list of urls that point to additional manifests.
	//     These will get automatically deployed by bootkube.
	//   examples:
	//     - |
	//       extraManifests:
	//         - "https://www.mysweethttpserver.com/manifest1.yaml"
	//         - "https://www.mysweethttpserver.com/manifest2.yaml"
	ExtraManifests []string `yaml:"extraManifests,omitempty"`
	//   description: |
	//     A map of key value pairs that will be added while fetching the ExtraManifests.
	//   examples:
	//     - |
	//       extraManifestHeaders:
	//         Token: "1234567"
	//         X-ExtraInfo: info
	ExtraManifestHeaders map[string]string `yaml:"extraManifestHeaders,omitempty"`
	//   description: |
	//     Settings for admin kubeconfig generation.
	//     Certificate lifetime can be configured.
	//   examples:
	//     - |
	//       adminKubeconfig:
	//         certLifetime: 1h
	AdminKubeconfigConfig AdminKubeconfigConfig `yaml:"adminKubeconfig,omitempty"`
}

ClusterConfig reperesents the cluster-wide config values

func (*ClusterConfig) AESCBCEncryptionSecret

func (c *ClusterConfig) AESCBCEncryptionSecret() string

AESCBCEncryptionSecret implements the Configurator interface.

func (*ClusterConfig) APIServer

func (c *ClusterConfig) APIServer() runtime.APIServer

APIServer implements the Configurator interface.

func (*ClusterConfig) AdminKubeconfig added in v0.4.0

func (c *ClusterConfig) AdminKubeconfig() runtime.AdminKubeconfig

AdminKubeconfig implements the Configurator interface.

func (*ClusterConfig) CA

CA implements the Configurator interface.

func (*ClusterConfig) CNI

func (c *ClusterConfig) CNI() runtime.CNI

CNI implements the Configurator interface.

func (*ClusterConfig) CertSANs

func (c *ClusterConfig) CertSANs() []string

CertSANs implements the Configurator interface.

func (*ClusterConfig) Config

func (c *ClusterConfig) Config(t runtime.MachineType) (string, error)

Config implements the Configurator interface.

func (*ClusterConfig) ControllerManager

func (c *ClusterConfig) ControllerManager() runtime.ControllerManager

ControllerManager implements the Configurator interface.

func (*ClusterConfig) CoreDNS added in v0.4.0

func (c *ClusterConfig) CoreDNS() runtime.CoreDNS

CoreDNS implements the Configurator interface.

func (*ClusterConfig) DNSDomain added in v0.4.0

func (c *ClusterConfig) DNSDomain() string

DNSDomain implements the Configurator interface.

func (*ClusterConfig) Endpoint

func (c *ClusterConfig) Endpoint() *url.URL

Endpoint implements the Configurator interface.

func (*ClusterConfig) Etcd

func (c *ClusterConfig) Etcd() runtime.Etcd

Etcd implements the Configurator interface.

func (*ClusterConfig) ExtraManifestHeaderMap added in v0.4.0

func (c *ClusterConfig) ExtraManifestHeaderMap() map[string]string

ExtraManifestHeaderMap implements the Configurator interface.

func (*ClusterConfig) ExtraManifestURLs

func (c *ClusterConfig) ExtraManifestURLs() []string

ExtraManifestURLs implements the Configurator interface.

func (*ClusterConfig) ID

func (c *ClusterConfig) ID() string

ID implements the Configurator interface.

func (*ClusterConfig) LocalAPIServerPort

func (c *ClusterConfig) LocalAPIServerPort() int

LocalAPIServerPort implements the Configurator interface.

func (*ClusterConfig) Name added in v0.3.2

func (c *ClusterConfig) Name() string

Name implements the Configurator interface.

func (*ClusterConfig) Network

func (c *ClusterConfig) Network() runtime.ClusterNetwork

Network implements the Configurator interface.

func (*ClusterConfig) PodCIDR

func (c *ClusterConfig) PodCIDR() string

PodCIDR implements the Configurator interface.

func (*ClusterConfig) PodCheckpointer added in v0.4.0

func (c *ClusterConfig) PodCheckpointer() runtime.PodCheckpointer

PodCheckpointer implements the Configurator interface.

func (*ClusterConfig) Proxy added in v0.5.0

func (c *ClusterConfig) Proxy() runtime.Proxy

Proxy implements the Configurator interface

func (*ClusterConfig) Scheduler

func (c *ClusterConfig) Scheduler() runtime.Scheduler

Scheduler implements the Configurator interface.

func (*ClusterConfig) Secret

func (c *ClusterConfig) Secret() string

Secret implements the Configurator interface.

func (*ClusterConfig) ServiceCIDR

func (c *ClusterConfig) ServiceCIDR() string

ServiceCIDR implements the Configurator interface.

func (*ClusterConfig) SetCertSANs

func (c *ClusterConfig) SetCertSANs(sans []string)

SetCertSANs implements the Configurator interface.

func (*ClusterConfig) Token

func (c *ClusterConfig) Token() runtime.Token

Token implements the Configurator interface.

type ClusterNetworkConfig

type ClusterNetworkConfig struct {
	//   description: |
	//     The CNI used.
	//     Composed of "name" and "url".
	//     The "name" key only supports upstream bootkube options of "flannel" or "custom".
	//     URLs is only used if name is equal to "custom".
	//     URLs should point to a single yaml file that will get deployed.
	//     Empty struct or any other name will default to bootkube's flannel.
	//   examples:
	//     - |
	//       cni:
	//         name: "custom"
	//         urls:
	//           - "https://www.mysweethttpserver.com/supersecretcni.yaml"
	CNI *CNIConfig `yaml:"cni,omitempty"`
	//   description: |
	//     The domain used by Kubernetes DNS.
	//     The default is `cluster.local`
	//   examples:
	//     - cluser.local
	DNSDomain string `yaml:"dnsDomain"`
	//   description: |
	//     The pod subnet CIDR.
	//   examples:
	//     -  |
	//       podSubnets:
	//         - 10.244.0.0/16
	PodSubnet []string `yaml:"podSubnets"`
	//   description: |
	//     The service subnet CIDR.
	//   examples:
	//     -  |
	//       serviceSubnets:
	//         - 10.96.0.0/12
	ServiceSubnet []string `yaml:"serviceSubnets"`
}

ClusterNetworkConfig represents kube networking config vals.

type Config

type Config struct {
	//   description: |
	//     Indicates the schema used to decode the contents.
	//   values:
	//     - "`v1alpha1`"
	ConfigVersion string `yaml:"version"`
	//   description: |
	//     Enable verbose logging.
	//   values:
	//     - true
	//     - yes
	//     - false
	//     - no
	ConfigDebug bool `yaml:"debug"`
	//   description: |
	//     Indicates whether to pull the machine config upon every boot.
	//   values:
	//     - true
	//     - yes
	//     - false
	//     - no
	ConfigPersist bool `yaml:"persist"`
	//   description: |
	//     Provides machine specific configuration options.
	MachineConfig *MachineConfig `yaml:"machine"`
	//   description: |
	//     Provides cluster specific configuration options.
	ClusterConfig *ClusterConfig `yaml:"cluster"`
}

Config defines the v1alpha1 configuration file.

func (*Config) Bytes added in v0.4.0

func (c *Config) Bytes() ([]byte, error)

Bytes implements the Configurator interface.

func (*Config) Cluster

func (c *Config) Cluster() runtime.ClusterConfig

Cluster implements the Configurator interface.

func (*Config) Debug

func (c *Config) Debug() bool

Debug implements the Configurator interface.

func (*Config) Machine

func (c *Config) Machine() runtime.MachineConfig

Machine implements the Configurator interface.

func (*Config) Persist added in v0.4.0

func (c *Config) Persist() bool

Persist implements the Configurator interface.

func (*Config) String

func (c *Config) String() (string, error)

String implements the Configurator interface.

func (*Config) Validate

func (c *Config) Validate(mode runtime.Mode) error

Validate implements the Configurator interface. nolint: gocyclo

func (*Config) Version

func (c *Config) Version() string

Version implements the Configurator interface.

type ConfigBundle added in v0.4.0

type ConfigBundle struct {
	InitCfg         *Config
	ControlPlaneCfg *Config
	JoinCfg         *Config
	TalosCfg        *config.Config
}

ConfigBundle defines the group of v1alpha1 config files. docgen: nodoc

func (*ConfigBundle) ControlPlane added in v0.4.0

func (c *ConfigBundle) ControlPlane() runtime.Configurator

ControlPlane implements the ConfiguratorBundle interface.

func (*ConfigBundle) Init added in v0.4.0

func (c *ConfigBundle) Init() runtime.Configurator

Init implements the ConfiguratorBundle interface.

func (*ConfigBundle) Join added in v0.4.0

func (c *ConfigBundle) Join() runtime.Configurator

Join implements the ConfiguratorBundle interface.

func (*ConfigBundle) TalosConfig added in v0.4.0

func (c *ConfigBundle) TalosConfig() *config.Config

TalosConfig implements the ConfiguratorBundle interface.

type ControlPlaneConfig

type ControlPlaneConfig struct {
	//   description: |
	//     Endpoint is the canonical controlplane endpoint, which can be an IP address or a DNS hostname.
	//     It is single-valued, and may optionally include a port number.
	//   examples:
	//     - https://1.2.3.4:443
	Endpoint *Endpoint `yaml:"endpoint"`
	//   description: |
	//     The port that the API server listens on internally.
	//     This may be different than the port portion listed in the endpoint field above.
	//     The default is 6443.
	LocalAPIServerPort int `yaml:"localAPIServerPort,omitempty"`
}

ControlPlaneConfig represents control plane config vals.

type ControllerManagerConfig

type ControllerManagerConfig struct {
	//   description: |
	//     The container image used in the controller manager manifest.
	Image string `yaml:"image,omitempty"`
	//   description: |
	//     Extra arguments to supply to the controller manager.
	ExtraArgsConfig map[string]string `yaml:"extraArgs,omitempty"`
}

ControllerManagerConfig represents kube controller manager config vals.

func (*ControllerManagerConfig) ExtraArgs

func (c *ControllerManagerConfig) ExtraArgs() map[string]string

ExtraArgs implements the Configurator interface.

type CoreDNS added in v0.4.0

type CoreDNS struct {
	//   description: |
	//     The `image` field is an override to the default coredns image.
	CoreDNSImage string `yaml:"image,omitempty"`
}

CoreDNS represents the coredns config values

func (*CoreDNS) Image added in v0.4.0

func (c *CoreDNS) Image() string

Image implements the Configurator interface.

type Endpoint

type Endpoint struct {
	*url.URL
}

Endpoint struct holds the endpoint url parsed out of machine config.

func (*Endpoint) MarshalYAML

func (e *Endpoint) MarshalYAML() (interface{}, error)

MarshalYAML is a custom unmarshaller for the endpoint struct.

func (*Endpoint) UnmarshalYAML

func (e *Endpoint) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML is a custom unmarshaller for the endpoint struct.

type EtcdConfig

type EtcdConfig struct {
	//   description: |
	//     The container image used to create the etcd service.
	ContainerImage string `yaml:"image,omitempty"`
	//   description: |
	//     The `ca` is the root certificate authority of the PKI.
	//     It is composed of a base64 encoded `crt` and `key`.
	//   examples:
	//     - |
	//       ca:
	//         crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUJIekNCMHF...
	//         key: LS0tLS1CRUdJTiBFRDI1NTE5IFBSSVZBVEUgS0VZLS0tLS0KTUM...
	RootCA *x509.PEMEncodedCertificateAndKey `yaml:"ca"`
	//   description: |
	//     Extra arguments to supply to etcd.
	//     Note that the following args are blacklisted:
	//
	//     - `name`
	//     - `data-dir`
	//     - `initial-cluster-state`
	//     - `listen-peer-urls`
	//     - `listen-client-urls`
	//     - `cert-file`
	//     - `key-file`
	//     - `trusted-ca-file`
	//     - `peer-client-cert-auth`
	//     - `peer-cert-file`
	//     - `peer-trusted-ca-file`
	//     - `peer-key-file`
	//   examples:
	//     - |
	//       extraArgs:
	//         initial-cluster: https://1.2.3.4:2380
	//         advertise-client-urls: https://1.2.3.4:2379
	EtcdExtraArgs map[string]string `yaml:"extraArgs,omitempty"`
}

EtcdConfig represents etcd config vals.

func (*EtcdConfig) CA

CA implements the Configurator interface.

func (*EtcdConfig) ExtraArgs

func (e *EtcdConfig) ExtraArgs() map[string]string

ExtraArgs implements the Configurator interface.

func (*EtcdConfig) Image

func (e *EtcdConfig) Image() string

Image implements the Configurator interface.

type InstallConfig

type InstallConfig struct {
	//   description: |
	//     The disk used to install the bootloader, and ephemeral partitions.
	//   examples:
	//     - /dev/sda
	//     - /dev/nvme0
	InstallDisk string `yaml:"disk,omitempty"`
	//   description: |
	//     Allows for supplying extra kernel args to the bootloader config.
	//   examples:
	//     - |
	//       extraKernelArgs:
	//         - a=b
	InstallExtraKernelArgs []string `yaml:"extraKernelArgs,omitempty"`
	//   description: |
	//     Allows for supplying the image used to perform the installation.
	//   examples:
	//     - |
	//       image: docker.io/<org>/installer:latest
	InstallImage string `yaml:"image,omitempty"`
	//   description: |
	//     Indicates if a bootloader should be installed.
	//   values:
	//     - true
	//     - yes
	//     - false
	//     - no
	InstallBootloader bool `yaml:"bootloader,omitempty"`
	//   description: |
	//     Indicates if zeroes should be written to the `disk` before performing and installation.
	//     Defaults to `true`.
	//   values:
	//     - true
	//     - yes
	//     - false
	//     - no
	InstallWipe bool `yaml:"wipe"`
	//   description: |
	//     Indicates if filesystems should be forcefully created.
	//   values:
	//     - true
	//     - yes
	//     - false
	//     - no
	InstallForce bool `yaml:"force"`
}

InstallConfig represents the installation options for preparing a node.

func (*InstallConfig) Disk

func (i *InstallConfig) Disk() string

Disk implements the Configurator interface.

func (*InstallConfig) ExtraKernelArgs

func (i *InstallConfig) ExtraKernelArgs() []string

ExtraKernelArgs implements the Configurator interface.

func (*InstallConfig) Force

func (i *InstallConfig) Force() bool

Force implements the Configurator interface.

func (*InstallConfig) Image

func (i *InstallConfig) Image() string

Image implements the Configurator interface.

func (*InstallConfig) WithBootloader

func (i *InstallConfig) WithBootloader() bool

WithBootloader implements the Configurator interface.

func (*InstallConfig) Zero

func (i *InstallConfig) Zero() bool

Zero implements the Configurator interface.

type KubeletConfig

type KubeletConfig struct {
	//   description: |
	//     The `image` field is an optional reference to an alternative hyperkube image.
	//   examples:
	//     - "image: docker.io/<org>/hyperkube:latest"
	KubeletImage string `yaml:"image,omitempty"`
	//   description: |
	//     The `extraArgs` field is used to provide additional flags to the kubelet.
	//   examples:
	//     - |
	//       extraArgs:
	//         key: value
	KubeletExtraArgs map[string]string `yaml:"extraArgs,omitempty"`
	//   description: |
	//     The `extraMounts` field is used to add additional mounts to the kubelet container.
	//   examples:
	//     - |
	//       extraMounts:
	//         - source: /var/lib/example
	//           destination: /var/lib/example
	//           type: bind
	//           options:
	//             - rshared
	//             - ro
	KubeletExtraMounts []specs.Mount `yaml:"extraMounts,omitempty"`
}

KubeletConfig reperesents the kubelet config values

func (*KubeletConfig) ExtraArgs

func (k *KubeletConfig) ExtraArgs() map[string]string

ExtraArgs implements the Configurator interface.

func (*KubeletConfig) ExtraMounts

func (k *KubeletConfig) ExtraMounts() []specs.Mount

ExtraMounts implements the Configurator interface.

func (*KubeletConfig) Image

func (k *KubeletConfig) Image() string

Image implements the Configurator interface.

type MachineConfig

type MachineConfig struct {
	//   description: |
	//     Defines the role of the machine within the cluster.
	//
	//     ##### Init
	//
	//     Init node type designates the first control plane node to come up.
	//     You can think of it like a bootstrap node.
	//     This node will perform the initial steps to bootstrap the cluster -- generation of TLS assets, starting of the control plane, etc.
	//
	//     ##### Control Plane
	//
	//     Control Plane node type designates the node as a control plane member.
	//     This means it will host etcd along with the Kubernetes master components such as API Server, Controller Manager, Scheduler.
	//
	//     ##### Worker
	//
	//     Worker node type designates the node as a worker node.
	//     This means it will be an available compute node for scheduling workloads.
	//   values:
	//     - "`init`"
	//     - "`controlplane`"
	//     - "`join`"
	MachineType string `yaml:"type"`
	//   description: |
	//     The `token` is used by a machine to join the PKI of the cluster.
	//     Using this token, a machine will create a certificate signing request (CSR), and request a certificate that will be used as its' identity.
	//   examples:
	//     - "token: 328hom.uqjzh6jnn2eie9oi"
	MachineToken string `yaml:"token"` // Warning: It is important to ensure that this token is correct since a machine's certificate has a short TTL by default
	//   description: |
	//     The root certificate authority of the PKI.
	//     It is composed of a base64 encoded `crt` and `key`.
	//   examples:
	//     - |
	//       ca:
	//         crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUJIekNCMHF...
	//         key: LS0tLS1CRUdJTiBFRDI1NTE5IFBSSVZBVEUgS0VZLS0tLS0KTUM...
	MachineCA *x509.PEMEncodedCertificateAndKey `yaml:"ca,omitempty"`
	//   description: |
	//     Extra certificate subject alternative names for the machine's certificate.
	//     By default, all non-loopback interface IPs are automatically added to the certificate's SANs.
	//   examples:
	//     - |
	//       certSANs:
	//         - 10.0.0.10
	//         - 172.16.0.10
	//         - 192.168.0.10
	MachineCertSANs []string `yaml:"certSANs"`
	//   description: |
	//     Used to provide additional options to the kubelet.
	//   examples:
	//     - |
	//       kubelet:
	//         image:
	//         extraArgs:
	//           key: value
	MachineKubelet *KubeletConfig `yaml:"kubelet,omitempty"`
	//   description: |
	//     Used to configure the machine's network.
	//   examples:
	//     - |
	//       network:
	//         hostname: worker-1
	//         interfaces:
	//         nameservers:
	//           - 9.8.7.6
	//           - 8.7.6.5
	MachineNetwork *NetworkConfig `yaml:"network,omitempty"`
	//   description: |
	//     Used to partition, format and mount additional disks.
	//     Since the rootfs is read only with the exception of `/var`, mounts are only valid if they are under `/var`.
	//     Note that the partitioning and formating is done only once, if and only if no existing  partitions are found.
	//   examples:
	//     - |
	//       disks:
	//         - device: /dev/sdb
	//           partitions:
	//             - size: 10000000000
	//               mountpoint: /var/lib/extra
	MachineDisks []runtime.Disk `yaml:"disks,omitempty"` // Note: `size` is in units of bytes.
	//   description: |
	//     Used to provide instructions for bare-metal installations.
	//   examples:
	//     - |
	//       install:
	//         disk: /dev/sda
	//         extraKernelArgs:
	//           - option=value
	//         image: docker.io/autonomy/installer:latest
	//         bootloader: true
	//         wipe: false
	//         force: false
	MachineInstall *InstallConfig `yaml:"install,omitempty"`
	//   description: |
	//     Allows the addition of user specified files.
	//     The value of `op` can be `create`, `overwrite`, or `append`.
	//     In the case of `create`, `path` must not exist.
	//     In the case of `overwrite`, and `append`, `path` must be a valid file.
	//     If an `op` value of `append` is used, the existing file will be appended.
	//     Note that the file contents are not required to be base64 encoded.
	//   examples:
	//     - |
	//       files:
	//         - content: |
	//             ...
	//           permissions: 0666
	//           path: /tmp/file.txt
	//           op: append
	MachineFiles []runtime.File `yaml:"files,omitempty"` // Note: The specified `path` is relative to `/var`.
	//   description: |
	//     The `env` field allows for the addition of environment variables to a machine.
	//     All environment variables are set on the machine in addition to every service.
	//   values:
	//     - "`GRPC_GO_LOG_VERBOSITY_LEVEL`"
	//     - "`GRPC_GO_LOG_SEVERITY_LEVEL`"
	//     - "`http_proxy`"
	//     - "`https_proxy`"
	//     - "`no_proxy`"
	//   examples:
	//     - |
	//       env:
	//         GRPC_GO_LOG_VERBOSITY_LEVEL: "99"
	//         GRPC_GO_LOG_SEVERITY_LEVEL: info
	//         https_proxy: http://SERVER:PORT/
	//     - |
	//       env:
	//         GRPC_GO_LOG_SEVERITY_LEVEL: error
	//         https_proxy: https://USERNAME:PASSWORD@SERVER:PORT/
	//     - |
	//       env:
	//         https_proxy: http://DOMAIN\\USERNAME:PASSWORD@SERVER:PORT/
	MachineEnv runtime.Env `yaml:"env,omitempty"`
	//   description: |
	//     Used to configure the machine's time settings.
	//   examples:
	//     - |
	//       time:
	//         servers:
	//           - time.cloudflare.com
	MachineTime *TimeConfig `yaml:"time,omitempty"`
	//   description: |
	//     Used to configure the machine's sysctls.
	//   examples:
	//     - |
	//       sysctls:
	//         kernel.domainname: talos.dev
	//         net.ipv4.ip_forward: "0"
	MachineSysctls map[string]string `yaml:"sysctls,omitempty"`
	//   description: |
	//     Used to configure the machine's container image registry mirrors.
	//
	//     Automatically generates matching CRI configuration for registry mirrors.
	//
	//     Section `mirrors` allows to redirect requests for images to non-default registry,
	//     which might be local registry or caching mirror.
	//
	//     Section `config` provides a way to authenticate to the registry with TLS client
	//     identity, provide registry CA, or authentication information.
	//     Authentication information has same meaning with the corresponding field in `.docker/config.json`.
	//
	//     See also matching configuration for [CRI containerd plugin](https://github.com/containerd/cri/blob/master/docs/registry.md).
	//   examples:
	//     - |
	//       registries:
	//         mirrors:
	//           docker.io:
	//             endpoints:
	//               - https://registry-1.docker.io
	//           '*':
	//             endpoints:
	//               - http://some.host:123/
	//        config:
	//         "some.host:123":
	//           tls:
	//             CA: ... # base64-encoded CA certificate in PEM format
	//             clientIdentity:
	//               cert: ...  # base64-encoded client certificate in PEM format
	//               key: ...  # base64-encoded client key in PEM format
	//           auth:
	//             username: ...
	//             password: ...
	//             auth: ...
	//             identityToken: ...
	MachineRegistries RegistriesConfig `yaml:"registries,omitempty"`
}

MachineConfig reperesents the machine-specific config values

func (*MachineConfig) CA

CA implements the Configurator interface.

func (*MachineConfig) CertSANs

func (m *MachineConfig) CertSANs() []string

CertSANs implements the Configurator interface.

func (*MachineConfig) Disks

func (m *MachineConfig) Disks() []runtime.Disk

Disks implements the Configurator interface.

func (*MachineConfig) Env

func (m *MachineConfig) Env() runtime.Env

Env implements the Configurator interface.

func (*MachineConfig) Files

func (m *MachineConfig) Files() ([]runtime.File, error)

Files implements the Configurator interface.

func (*MachineConfig) Install

func (m *MachineConfig) Install() runtime.Install

Install implements the Configurator interface.

func (*MachineConfig) Kubelet

func (m *MachineConfig) Kubelet() runtime.Kubelet

Kubelet implements the Configurator interface.

func (*MachineConfig) Network

func (m *MachineConfig) Network() runtime.MachineNetwork

Network implements the Configurator interface.

func (*MachineConfig) Registries added in v0.4.0

func (m *MachineConfig) Registries() runtime.Registries

Registries implements the Configurator interface.

func (*MachineConfig) Security

func (m *MachineConfig) Security() runtime.Security

Security implements the Configurator interface.

func (*MachineConfig) Server

func (m *MachineConfig) Server() string

Server implements the Configurator interface.

func (*MachineConfig) SetCertSANs

func (m *MachineConfig) SetCertSANs(sans []string)

SetCertSANs implements the Configurator interface.

func (*MachineConfig) Sysctls

func (m *MachineConfig) Sysctls() map[string]string

Sysctls implements the Configurator interface.

func (*MachineConfig) Time

func (m *MachineConfig) Time() runtime.Time

Time implements the Configurator interface.

func (*MachineConfig) Token

func (m *MachineConfig) Token() string

Token implements the Configurator interface.

func (*MachineConfig) Type

func (m *MachineConfig) Type() runtime.MachineType

Type implements the Configurator interface.

type NetworkConfig

type NetworkConfig struct {
	//   description: |
	//     Used to statically set the hostname for the host.
	NetworkHostname string `yaml:"hostname,omitempty"`
	//   description: |
	//     `interfaces` is used to define the network interface configuration.
	//     By default all network interfaces will attempt a DHCP discovery.
	//     This can be further tuned through this configuration parameter.
	//
	//     ##### machine.network.interfaces.interface
	//
	//     This is the interface name that should be configured.
	//
	//     ##### machine.network.interfaces.cidr
	//
	//     `cidr` is used to specify a static IP address to the interface.
	//     This should be in proper CIDR notation ( `192.168.2.5/24` ).
	//
	//     > Note: This option is mutually exclusive with DHCP.
	//
	//     ##### machine.network.interfaces.dhcp
	//
	//     `dhcp` is used to specify that this device should be configured via DHCP.
	//
	//     The following DHCP options are supported:
	//
	//     - `OptionClasslessStaticRoute`
	//     - `OptionDomainNameServer`
	//     - `OptionDNSDomainSearchList`
	//     - `OptionHostName`
	//
	//     > Note: This option is mutually exclusive with CIDR.
	//
	//     ##### machine.network.interfaces.ignore
	//
	//     `ignore` is used to exclude a specific interface from configuration.
	//     This parameter is optional.
	//
	//     ##### machine.network.interfaces.routes
	//
	//     `routes` is used to specify static routes that may be necessary.
	//     This parameter is optional.
	//
	//     Routes can be repeated and includes a `Network` and `Gateway` field.
	NetworkInterfaces []runtime.Device `yaml:"interfaces,omitempty"`
	//   description: |
	//     Used to statically set the nameservers for the host.
	//     Defaults to `1.1.1.1` and `8.8.8.8`
	NameServers []string `yaml:"nameservers,omitempty"`
	//   description: |
	//     Allows for extra entries to be added to /etc/hosts file
	//   examples:
	//     - |
	//       extraHostEntries:
	//         - ip: 192.168.1.100
	//           aliases:
	//             - test
	//             - test.domain.tld
	ExtraHostEntries []runtime.ExtraHost `yaml:"extraHostEntries,omitempty"`
}

NetworkConfig reperesents the machine's networking config values.

func (*NetworkConfig) Devices

func (n *NetworkConfig) Devices() []runtime.Device

Devices implements the Configurator interface.

func (*NetworkConfig) ExtraHosts added in v0.4.0

func (n *NetworkConfig) ExtraHosts() []runtime.ExtraHost

ExtraHosts implements the Configurator interface.

func (*NetworkConfig) Hostname

func (n *NetworkConfig) Hostname() string

Hostname implements the Configurator interface.

func (*NetworkConfig) Resolvers

func (n *NetworkConfig) Resolvers() []string

Resolvers implements the Configurator interface.

func (*NetworkConfig) SetHostname

func (n *NetworkConfig) SetHostname(hostname string)

SetHostname implements the Configurator interface.

type NetworkDeviceCheck

type NetworkDeviceCheck func(runtime.Device) error

NetworkDeviceCheck defines the function type for checks. nolint: dupl

type PodCheckpointer added in v0.4.0

type PodCheckpointer struct {
	//   description: |
	//     The `image` field is an override to the default pod-checkpointer image.
	PodCheckpointerImage string `yaml:"image,omitempty"`
}

PodCheckpointer represents the pod-checkpointer config values

func (*PodCheckpointer) Image added in v0.4.0

func (p *PodCheckpointer) Image() string

Image implements the Configurator interface.

type ProxyConfig added in v0.5.0

type ProxyConfig struct {
	//   description: |
	//     proxy mode of kube-proxy.
	//     By default, this is 'iptables'.
	ModeConfig string `yaml:"mode,omitempty"`
	//   description: |
	//     Extra arguments to supply to kube-proxy.
	ExtraArgsConfig map[string]string `yaml:"extraArgs,omitempty"`
}

ProxyConfig represents the kube proxy configuration values

func (*ProxyConfig) ExtraArgs added in v0.5.0

func (p *ProxyConfig) ExtraArgs() map[string]string

ExtraArgs implements the Proxy interface.

func (*ProxyConfig) Mode added in v0.5.0

func (p *ProxyConfig) Mode() string

Mode implements the Proxy interface

type RegistriesConfig added in v0.4.0

type RegistriesConfig struct {
	//   description: |
	//     Specifies mirror configuration for each registry.
	//     This setting allows to use local pull-through caching registires,
	//     air-gapped installations, etc.
	//
	//     Registry name is the first segment of image identifier, with 'docker.io'
	//     being default one.
	//     Name '*' catches any registry names not specified explicitly.
	RegistryMirrors map[string]runtime.RegistryMirrorConfig `yaml:"mirrors,omitempty"`
	//   description: |
	//     Specifies TLS & auth configuration for HTTPS image registries.
	//     Mutual TLS can be enabled with 'clientIdentity' option.
	//
	//     TLS configuration can be skipped if registry has trusted
	//     server certificate.
	RegistryConfig map[string]runtime.RegistryConfig `yaml:"config,omitempty"`
}

RegistriesConfig represents the image pull options.

func (*RegistriesConfig) Config added in v0.4.0

Config implements the Registries interface.

func (*RegistriesConfig) ExtraFiles added in v0.4.0

func (r *RegistriesConfig) ExtraFiles() ([]runtime.File, error)

ExtraFiles implements the Registries interface.

func (*RegistriesConfig) Mirrors added in v0.4.0

Mirrors implements the Registries interface.

type SchedulerConfig

type SchedulerConfig struct {
	//   description: |
	//     The container image used in the scheduler manifest.
	Image string `yaml:"image,omitempty"`
	//   description: |
	//     Extra arguments to supply to the scheduler.
	ExtraArgsConfig map[string]string `yaml:"extraArgs,omitempty"`
}

SchedulerConfig represents kube scheduler config vals.

func (*SchedulerConfig) ExtraArgs

func (s *SchedulerConfig) ExtraArgs() map[string]string

ExtraArgs implements the Configurator interface.

type TimeConfig

type TimeConfig struct {
	//   description: |
	//     Specifies time (ntp) servers to use for setting system time.
	//     Defaults to `pool.ntp.org`
	//
	//     > Note: This parameter only supports a single time server
	TimeServers []string `yaml:"servers,omitempty"`
}

TimeConfig represents the options for configuring time on a node.

func (*TimeConfig) Servers

func (t *TimeConfig) Servers() []string

Servers implements the Configurator interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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