Documentation ¶
Overview ¶
Copyright 2020 Mirantis, Inc.
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 2020 Mirantis, Inc.
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 2020 Mirantis, Inc.
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 2020 Mirantis, Inc.
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 2020 Mirantis, Inc.
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 2020 Mirantis, Inc.
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 2020 Mirantis, Inc.
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 2020 Mirantis, Inc.
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 2020 Mirantis, Inc.
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 2020 Mirantis, Inc.
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
- type APISpec
- type CaResponse
- type Calico
- type CalicoImageSpec
- type Chart
- type ClusterConfig
- type ClusterExtensions
- type ClusterImages
- type ClusterMeta
- type ClusterSpec
- type ClusterTelemetry
- type ControllerManagerSpec
- type EtcdConfig
- type EtcdRequest
- type EtcdResponse
- type HelmExtensions
- type ImageSpec
- type InstallSpec
- type JoinClient
- type KineConfig
- type Network
- 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 ¶
This section is empty.
Types ¶
type APISpec ¶
type APISpec struct { Address string `yaml:"address"` ExternalAddress string `yaml:"externalAddress"` SANs []string `yaml:"sans"` ExtraArgs map[string]string `yaml:"extraArgs"` }
APISpec ...
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 reponse 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"` }
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"` FlexVolume ImageSpec `yaml:"flexvolume"` 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"` Extensions *ClusterExtensions `yaml:"extensions,omitempty"` Images *ClusterImages `yaml:"images"` Install *InstallSpec `yaml:"installConfig,omitempty"` Kind string `yaml:"kind" validate:"eq=Cluster"` Metadata *ClusterMeta `yaml:"metadata"` Spec *ClusterSpec `yaml:"spec"` Telemetry *ClusterTelemetry `yaml:"telemetry"` }
ClusterConfig cluster manifest
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"` }
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"` Scheduler *SchedulerSpec `yaml:"scheduler"` Storage *StorageSpec `yaml:"storage"` Network *Network `yaml:"network"` PodSecurityPolicy *PodSecurityPolicy `yaml:"podSecurityPolicy"` WorkerProfiles WorkerProfiles `yaml:"workerProfiles"` }
ClusterSpec ...
func DefaultClusterSpec ¶
func DefaultClusterSpec() *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 ...
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"` }
Network defines the network related config options
func DefaultNetwork ¶
func DefaultNetwork() *Network
DefaultNetwork creates the Network config struct with sane default values
func (*Network) DNSAddress ¶
DNSAddress calculates the 10th address of configured service CIDR block.
func (*Network) InternalAPIAddress ¶
InternalAPIAddress 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
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 ...
type StorageSpec ¶
type StorageSpec struct { Type string `yaml:"type"` Kine *KineConfig `yaml:"kine"` Etcd *EtcdConfig `yaml:"etcd"` }
StorageSpec defines the storage related config options
func DefaultStorageSpec ¶
func DefaultStorageSpec() *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
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