Documentation ¶
Overview ¶
Copyright 2021 k0s authors
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2021 k0s authors ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2021 k0s authors ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2021 k0s authors ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2021 k0s authors ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2021 k0s authors ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2021 k0s authors ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2021 k0s authors ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2021 k0s authors ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2021 k0s authors ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2021 k0s authors ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- func IsIPv6String(ip string) bool
- type APISpec
- type CaResponse
- type Calico
- type CalicoImageSpec
- type Chart
- type ClusterConfig
- func DefaultClusterConfig(k0sVars constant.CfgVars) *ClusterConfig
- func FromYamlFile(filename string, k0sVars constant.CfgVars) (*ClusterConfig, error)
- func FromYamlPipe(r io.Reader, k0sVars constant.CfgVars) (*ClusterConfig, error)
- func FromYamlString(yml string, k0sVars constant.CfgVars) (*ClusterConfig, error)
- type ClusterExtensions
- type ClusterImages
- type ClusterMeta
- type ClusterSpec
- type ClusterTelemetry
- type ControllerManagerSpec
- type DualStack
- type EtcdConfig
- type EtcdRequest
- type EtcdResponse
- type HelmExtensions
- type ImageSpec
- type InstallSpec
- type JoinClient
- type KineConfig
- type Network
- func (n *Network) BuildPodCIDR() string
- func (n *Network) BuildServiceCIDR(addr string) string
- func (n *Network) DNSAddress() (string, error)
- func (n *Network) InternalAPIAddresses() ([]string, error)
- func (n *Network) UnmarshalYAML(unmarshal func(interface{}) error) error
- func (n *Network) Validate() []error
- type PodSecurityPolicy
- type Repository
- type SchedulerSpec
- type StorageSpec
- type SystemUser
- type WorkerProfile
- type WorkerProfiles
Constants ¶
const ( EtcdStorageType = "etcd" KineStorageType = "kine" )
supported storage types
Variables ¶
This section is empty.
Functions ¶
func IsIPv6String ¶ added in v0.11.0
IsIPv6String returns if ip is IPv6.
Types ¶
type APISpec ¶
type APISpec struct { Address string `yaml:"address"` ExternalAddress string `yaml:"externalAddress,omitempty"` SANs []string `yaml:"sans"` ExtraArgs map[string]string `yaml:"extraArgs,omitempty"` }
APISpec ...
func (*APISpec) APIAddressURL ¶ added in v0.10.0
func (*APISpec) K0sControlPlaneAPIAddress ¶ added in v0.9.0
K0sControlPlaneAPIAddress returns the controller join APIs address
type CaResponse ¶
type CaResponse struct { Key []byte `json:"key"` Cert []byte `json:"cert"` SAKey []byte `json:"saKey"` SAPub []byte `json:"saPub"` }
CaResponse defines the response type for /ca control API
type Calico ¶
type Calico struct { Mode string `yaml:"mode"` VxlanPort int `yaml:"vxlanPort"` VxlanVNI int `yaml:"vxlanVNI"` MTU int `yaml:"mtu"` EnableWireguard bool `yaml:"wireguard"` FlexVolumeDriverPath string `yaml:"flexVolumeDriverPath"` WithWindowsNodes bool `yaml:"withWindowsNodes"` Overlay string `yaml:"overlay" validate:"oneof=Always Never CrossSubnet"` IPAutodetectionMethod string `yaml:"ipAutodetectionMethod,omitempty"` }
Calico defines the calico related config options
func (*Calico) UnmarshalYAML ¶
UnmarshalYAML sets in some sane defaults when unmarshaling the data from yaml
type CalicoImageSpec ¶
type CalicoImageSpec struct { CNI ImageSpec `yaml:"cni"` Node ImageSpec `yaml:"node"` KubeControllers ImageSpec `yaml:"kubecontrollers"` }
CalicoImageSpec config group for calico related image settings
type Chart ¶
type Chart struct { Name string `yaml:"name"` ChartName string `yaml:"chartname"` Version string `yaml:"version"` Values string `yaml:"values"` TargetNS string `yaml:"namespace"` }
Chart single helm addon
type ClusterConfig ¶
type ClusterConfig struct { APIVersion string `yaml:"apiVersion" validate:"eq=k0s.k0sproject.io/v1beta1"` Kind string `yaml:"kind" validate:"eq=Cluster"` Metadata *ClusterMeta `yaml:"metadata"` Spec *ClusterSpec `yaml:"spec"` // contains filtered or unexported fields }
ClusterConfig cluster manifest
func DefaultClusterConfig ¶
func DefaultClusterConfig(k0sVars constant.CfgVars) *ClusterConfig
DefaultClusterConfig ...
func FromYamlFile ¶ added in v0.10.0
func FromYamlFile(filename string, k0sVars constant.CfgVars) (*ClusterConfig, error)
FromYamlFile ...
func FromYamlPipe ¶ added in v0.10.0
FromYamlPipe
func FromYamlString ¶ added in v0.10.0
func FromYamlString(yml string, k0sVars constant.CfgVars) (*ClusterConfig, error)
FromYamlString
func (*ClusterConfig) UnmarshalYAML ¶
func (c *ClusterConfig) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML sets in some sane defaults when unmarshaling the data from yaml
func (*ClusterConfig) Validate ¶
func (c *ClusterConfig) Validate() []error
Validate validates cluster config
type ClusterExtensions ¶
type ClusterExtensions struct {
Helm *HelmExtensions `yaml:"helm"`
}
ClusterExtensions specifies cluster extensions
type ClusterImages ¶
type ClusterImages struct { Konnectivity ImageSpec `yaml:"konnectivity"` MetricsServer ImageSpec `yaml:"metricsserver"` KubeProxy ImageSpec `yaml:"kubeproxy"` CoreDNS ImageSpec `yaml:"coredns"` Calico CalicoImageSpec `yaml:"calico"` Repository string `yaml:"repository,omitempty"` DefaultPullPolicy string `yaml:"default_pull_policy,omitempty"` }
ClusterImages sets docker images for addon components
func DefaultClusterImages ¶
func DefaultClusterImages() *ClusterImages
DefaultClusterImages default image settings
func (*ClusterImages) UnmarshalYAML ¶
func (ci *ClusterImages) UnmarshalYAML(unmarshal func(interface{}) error) error
type ClusterMeta ¶
type ClusterMeta struct {
Name string `yaml:"name" validate:"required"`
}
ClusterMeta ...
type ClusterSpec ¶
type ClusterSpec struct { API *APISpec `yaml:"api"` ControllerManager *ControllerManagerSpec `yaml:"controllerManager,omitempty"` Scheduler *SchedulerSpec `yaml:"scheduler,omitempty"` Storage *StorageSpec `yaml:"storage"` Network *Network `yaml:"network"` PodSecurityPolicy *PodSecurityPolicy `yaml:"podSecurityPolicy"` WorkerProfiles WorkerProfiles `yaml:"workerProfiles,omitempty"` Telemetry *ClusterTelemetry `yaml:"telemetry"` Install *InstallSpec `yaml:"installConfig,omitempty"` Images *ClusterImages `yaml:"images"` Extensions *ClusterExtensions `yaml:"extensions,omitempty"` }
ClusterSpec ...
func DefaultClusterSpec ¶
func DefaultClusterSpec(k0sVars constant.CfgVars) *ClusterSpec
DefaultClusterSpec default settings
type ClusterTelemetry ¶
type ClusterTelemetry struct { Interval time.Duration `yaml:"interval"` Enabled bool `yaml:"enabled"` }
ClusterTelemetry holds telemetry related settings
func DefaultClusterTelemetry ¶
func DefaultClusterTelemetry() *ClusterTelemetry
DefaultClusterTelemetry default settings
type ControllerManagerSpec ¶
ControllerManagerSpec ...
func (*ControllerManagerSpec) IsZero ¶ added in v0.10.0
func (c *ControllerManagerSpec) IsZero() bool
IsZero needed to omit empty object from yaml output
type DualStack ¶ added in v0.10.0
type DualStack struct { Enabled bool `yaml:"enabled,omitempty"` IPv6PodCIDR string `yaml:"IPv6podCIDR,omitempty"` IPv6ServiceCIDR string `yaml:"IPv6serviceCIDR,omitempty"` }
DualStack defines network configuration for ipv4\ipv6 mixed cluster setup
func DefaultDualStack ¶ added in v0.10.0
func DefaultDualStack() DualStack
DefaultDualStack builds default values
func (DualStack) EnableDualStackFeatureGate ¶ added in v0.10.0
EnableDualStackFeatureGate adds ipv6 feature gate to the given args colllection
type EtcdConfig ¶
type EtcdConfig struct {
PeerAddress string `yaml:"peerAddress"`
}
EtcdConfig defines etcd related config options
func DefaultEtcdConfig ¶
func DefaultEtcdConfig() *EtcdConfig
DefaultEtcdConfig creates EtcdConfig with sane defaults
type EtcdRequest ¶
EtcdRequest defines the etcd control api request structure
func (*EtcdRequest) Validate ¶
func (e *EtcdRequest) Validate() error
Validate validates the request
type EtcdResponse ¶
type EtcdResponse struct { CA CaResponse `json:"ca"` InitialCluster []string `json:"initialCluster"` }
EtcdResponse defines the etcd control api response structure
type HelmExtensions ¶
type HelmExtensions struct { Repositories []Repository `yaml:"repositories"` Charts []Chart `yaml:"charts"` }
HelmExtensions specifies settings for cluster helm based extensions
type InstallSpec ¶ added in v0.9.0
type InstallSpec struct {
SystemUsers *SystemUser `yaml:"users,omitempty"`
}
InstallSpec defines the required fields for the `k0s install` command
func DefaultInstallSpec ¶ added in v0.9.0
func DefaultInstallSpec() *InstallSpec
DefaultInstallSpec ...
type JoinClient ¶
type JoinClient struct {
// contains filtered or unexported fields
}
JoinClient is the client we can use to call k0s join APIs
func JoinClientFromToken ¶
func JoinClientFromToken(encodedToken string) (*JoinClient, error)
JoinClientFromToken creates a new join api client from a token
func (*JoinClient) GetCA ¶
func (j *JoinClient) GetCA() (CaResponse, error)
GetCA calls the CA sync API
func (*JoinClient) JoinEtcd ¶
func (j *JoinClient) JoinEtcd(peerAddress string) (EtcdResponse, error)
JoinEtcd calls the etcd join API
type KineConfig ¶
type KineConfig struct {
DataSource string `yaml:"dataSource"`
}
KineConfig defines the Kine related config options
func DefaultKineConfig ¶
func DefaultKineConfig(dataDir string) *KineConfig
DefaultKineConfig creates KineConfig with sane defaults
type Network ¶
type Network struct { PodCIDR string `yaml:"podCIDR"` ServiceCIDR string `yaml:"serviceCIDR"` Provider string `yaml:"provider"` Calico *Calico `yaml:"calico"` DualStack DualStack `yaml:"dualStack,omitempty"` }
Network defines the network related config options
func DefaultNetwork ¶
func DefaultNetwork() *Network
DefaultNetwork creates the Network config struct with sane default values
func (*Network) BuildPodCIDR ¶ added in v0.10.0
BuildPodCIDR returns actual argument value for pod cidr
func (*Network) BuildServiceCIDR ¶ added in v0.10.0
BuildServiceCIDR returns actual argument value for service cidr
func (*Network) DNSAddress ¶
DNSAddress calculates the 10th address of configured service CIDR block.
func (*Network) InternalAPIAddresses ¶ added in v0.11.0
InternalAPIAddresses calculates the internal API address of configured service CIDR block.
func (*Network) UnmarshalYAML ¶
UnmarshalYAML sets in some sane defaults when unmarshaling the data from yaml
type PodSecurityPolicy ¶
type PodSecurityPolicy struct {
DefaultPolicy string `yaml:"defaultPolicy"`
}
PodSecurityPolicy defines the config options for setting system level default PSP
func DefaultPodSecurityPolicy ¶
func DefaultPodSecurityPolicy() *PodSecurityPolicy
DefaultPodSecurityPolicy creates new PodSecurityPolicy with sane defaults
func (*PodSecurityPolicy) Validate ¶ added in v0.11.0
func (p *PodSecurityPolicy) Validate() []error
Validate check that the given psp is one of the built-in ones
type Repository ¶
type Repository struct { Name string `yaml:"name"` URL string `yaml:"url"` CAFile string `yaml:"caFile"` CertFile string `yaml:"certFile"` Insecure bool `yaml:"insecure"` KeyFile string `yaml:"keyfile"` Username string `yaml:"username"` Password string `yaml:"password"` }
Repository describes single repository entry. Fields map to the CLI flags for the "helm add" command
type SchedulerSpec ¶
SchedulerSpec ...
func (*SchedulerSpec) IsZero ¶ added in v0.10.0
func (s *SchedulerSpec) IsZero() bool
IsZero needed to omit empty object from yaml output
type StorageSpec ¶
type StorageSpec struct { Type string `yaml:"type"` Kine *KineConfig `yaml:"kine,omitempty"` Etcd *EtcdConfig `yaml:"etcd"` }
StorageSpec defines the storage related config options
func DefaultStorageSpec ¶
func DefaultStorageSpec(k0sVars constant.CfgVars) *StorageSpec
DefaultStorageSpec creates StorageSpec with sane defaults
func (*StorageSpec) IsJoinable ¶
func (s *StorageSpec) IsJoinable() bool
IsJoinable returns true only if the storage config is such that another controller can join the cluster
func (*StorageSpec) UnmarshalYAML ¶
func (s *StorageSpec) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML sets in some sane defaults when unmarshaling the data from yaml
func (*StorageSpec) Validate ¶ added in v0.11.0
func (s *StorageSpec) Validate() []error
Validate validates storage specs correctness
type SystemUser ¶ added in v0.9.0
type SystemUser struct { Etcd string `yaml:"etcdUser,omitempty"` Kine string `yaml:"kineUser,omitempty"` Konnectivity string `yaml:"konnectivityUser,omitempty"` KubeAPIServer string `yaml:"kubeAPIserverUser,omitempty"` KubeScheduler string `yaml:"kubeSchedulerUser,omitempty"` }
SystemUser defines the user to use for each component
func DefaultSystemUsers ¶ added in v0.9.0
func DefaultSystemUsers() *SystemUser
DefaultSystemUsers returns the default system users to be used for the different components
type WorkerProfile ¶
type WorkerProfile struct { Name string `yaml:"name"` Values map[string]interface{} `yaml:"values"` }
WorkerProfile worker profile
func (*WorkerProfile) Validate ¶
func (wp *WorkerProfile) Validate() error
Validate validates instance
type WorkerProfiles ¶
type WorkerProfiles []WorkerProfile
WorkerProfiles profiles collection
func (WorkerProfiles) Validate ¶
func (wps WorkerProfiles) Validate() []error
Validate validates all profiles