v1beta1

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2020 License: Apache-2.0 Imports: 18 Imported by: 6

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

View Source
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"`
	SANs      []string          `yaml:"sans"`
	ExtraArgs map[string]string `yaml:"extraArgs"`
}

APISpec ...

func DefaultAPISpec

func DefaultAPISpec() *APISpec

DefaultAPISpec default settings

func (*APISpec) APIAddress

func (a *APISpec) APIAddress() string

APIAddress ...

func (*APISpec) ControllerJoinAddress

func (a *APISpec) ControllerJoinAddress() string

ControllerJoinAddress 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"`
}

Calico defines the calico related config options

func DefaultCalico

func DefaultCalico() *Calico

DefaultCalico returns sane defaults for calico

func (*Calico) UnmarshalYAML

func (c *Calico) UnmarshalYAML(unmarshal func(interface{}) error) error

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"`
	Kind       string             `yaml:"kind" validate:"eq=Cluster"`
	Metadata   *ClusterMeta       `yaml:"metadata"`
	Spec       *ClusterSpec       `yaml:"spec"`
	Extensions *ClusterExtensions `yaml:"extensions"`
	Images     *ClusterImages     `yaml:"images"`
	Telemetry  *ClusterTelemetry  `yaml:"telemetry"`
}

ClusterConfig cluster manifest

func DefaultClusterConfig

func DefaultClusterConfig() *ClusterConfig

DefaultClusterConfig ...

func FromYaml

func FromYaml(filename string) (*ClusterConfig, error)

FromYaml ...

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"`
}

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

type ControllerManagerSpec struct {
	ExtraArgs map[string]string `yaml:"extraArgs"`
}

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

type EtcdRequest struct {
	Node        string `json:"node"`
	PeerAddress string `json:"peerAddress"`
}

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 ImageSpec

type ImageSpec struct {
	Image   string `yaml:"image"`
	Version string `yaml:"version"`
}

ImageSpec container image settings

func (ImageSpec) URI

func (is ImageSpec) URI() string

URI build image uri

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

func (n *Network) DNSAddress() (string, error)

DNSAddress calculates the 10th address of configured service CIDR block.

func (*Network) InternalAPIAddress

func (n *Network) InternalAPIAddress() (string, error)

InternalAPIAddress calculates the internal API address of configured service CIDR block.

func (*Network) UnmarshalYAML

func (n *Network) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML sets in some sane defaults when unmarshaling the data from yaml

func (*Network) Validate

func (n *Network) Validate() []error

Validate validates all the settings make sense and should work

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

type SchedulerSpec struct {
	ExtraArgs map[string]string `yaml:"extraArgs"`
}

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 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

Jump to

Keyboard shortcuts

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