config

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIServerConfig

type APIServerConfig struct {
	Address string `json:"address"`
}

APIServerConfig describes the load balancer address.

type Cluster

type Cluster struct {
	Name              string                  `json:"name"`
	Hosts             []*HostConfig           `json:"hosts"`
	APIServer         APIServerConfig         `json:"apiserver"`
	Provider          ProviderConfig          `json:"provider"`
	Versions          VersionConfig           `json:"versions"`
	Network           NetworkConfig           `json:"network"`
	Proxy             ProxyConfig             `json:"proxy"`
	Workers           []WorkerConfig          `json:"workers"`
	MachineController MachineControllerConfig `json:"machine_controller"`
	Features          Features                `json:"features"`
}

Cluster describes our entire configuration.

func (*Cluster) DefaultAndValidate

func (m *Cluster) DefaultAndValidate() error

DefaultAndValidate checks if the cluster config makes sense.

func (*Cluster) Followers

func (m *Cluster) Followers() []*HostConfig

Followers returns all but the first configured host. Only call this after validating the cluster config to ensure hosts exist.

func (*Cluster) Leader

func (m *Cluster) Leader() (*HostConfig, error)

Leader returns the first configured host. Only call this after validating the cluster config to ensure a leader exists.

type Features added in v0.3.0

type Features struct {
	EnablePodSecurityPolicy bool `json:"enable_pod_security_policy"`
	EnableDynamicAuditLog   bool `json:"enable_dynamic_audit_log"`
}

Features switches

type HostConfig

type HostConfig struct {
	ID                int    `json:"-"`
	PublicAddress     string `json:"public_address"`
	PrivateAddress    string `json:"private_address"`
	SSHPort           int    `json:"ssh_port"`
	SSHUsername       string `json:"ssh_username"`
	SSHPrivateKeyFile string `json:"ssh_private_key_file"`
	SSHAgentSocket    string `json:"ssh_agent_socket"`

	// runtime information
	Hostname        string `json:"-"`
	OperatingSystem string `json:"-"`
	IsLeader        bool   `json:"-"`
}

HostConfig describes a single master node.

func (*HostConfig) AddDefaultsAndValidate

func (m *HostConfig) AddDefaultsAndValidate() error

AddDefaultsAndValidate checks if the Config makes sense.

type MachineControllerConfig

type MachineControllerConfig struct {
	Deploy *bool `json:"deploy"`
	// Provider is provider to be used for machine-controller
	// Defaults and must be same as chosen cloud provider, unless cloud provider is set to None
	Provider    ProviderName      `json:"provider"`
	Credentials map[string]string `json:"credentials"`
}

MachineControllerConfig controls

func (*MachineControllerConfig) DefaultAndValidate

func (m *MachineControllerConfig) DefaultAndValidate(cloudProvider ProviderName) error

DefaultAndValidate checks if the machine-controller config makes sense.

type NetworkConfig

type NetworkConfig struct {
	PodSubnetVal     string `json:"pod_subnet"`
	ServiceSubnetVal string `json:"service_subnet"`
	NodePortRangeVal string `json:"node_port_range"`
}

NetworkConfig describes the node network.

func (*NetworkConfig) NodePortRange

func (m *NetworkConfig) NodePortRange() string

NodePortRange returns the node port range or the default value.

func (*NetworkConfig) PodSubnet

func (m *NetworkConfig) PodSubnet() string

PodSubnet returns the pod subnet or the default value.

func (*NetworkConfig) ServiceSubnet

func (m *NetworkConfig) ServiceSubnet() string

ServiceSubnet returns the service subnet or the default value.

func (*NetworkConfig) Validate

func (m *NetworkConfig) Validate() error

Validate checks the NetworkConfig for errors

type ProviderConfig

type ProviderConfig struct {
	Name        ProviderName `json:"name"`
	External    bool         `json:"external"`
	CloudConfig string       `json:"cloud_config"`
}

ProviderConfig describes the cloud provider that is running the machines.

func (*ProviderConfig) CloudProviderInTree

func (p *ProviderConfig) CloudProviderInTree() bool

CloudProviderInTree detects is there in-tree cloud provider implementation for specified provider. List of in-tree provider can be found here: https://github.com/kubernetes/kubernetes/tree/master/pkg/cloudprovider

func (*ProviderConfig) Validate

func (p *ProviderConfig) Validate() error

Validate checks the ProviderConfig for errors

type ProviderEnvironmentVariable added in v0.4.0

type ProviderEnvironmentVariable struct {
	Name                  string
	MachineControllerName string
}

ProviderEnvironmentVariable is used to match environment variable used by KubeOne to environment variable used by machine-controller.

type ProviderName

type ProviderName string

ProviderName represents the name of an provider

const (
	ProviderNameAWS          ProviderName = "aws"
	ProviderNameOpenStack    ProviderName = "openstack"
	ProviderNameHetzner      ProviderName = "hetzner"
	ProviderNameDigitalOcean ProviderName = "digitalocean"
	ProviderNameVSphere      ProviderName = "vshere"
	ProviderNameNone         ProviderName = "none"
)

ProviderName values

func (ProviderName) ProviderCredentials

func (p ProviderName) ProviderCredentials() (map[string]string, error)

ProviderCredentials match the cloudprovider and parses its credentials from environment

type ProxyConfig

type ProxyConfig struct {
	HTTPProxy  string `json:"http_proxy"`
	HTTPSProxy string `json:"https_proxy"`
	NoProxy    string `json:"no_proxy"`
}

ProxyConfig object

type VersionConfig

type VersionConfig struct {
	Kubernetes string `json:"kubernetes"`
}

VersionConfig describes the versions of Kubernetes that is installed.

func (*VersionConfig) KubernetesCNIVersion added in v0.4.1

func (m *VersionConfig) KubernetesCNIVersion() string

KubernetesCNIVersion returns kubernetes-cni package version

func (*VersionConfig) Validate

func (m *VersionConfig) Validate() error

Validate semversion of config

type WorkerConfig

type WorkerConfig struct {
	Name     string         `json:"name"`
	Replicas *int           `json:"replicas"`
	Config   providerConfig `json:"config"`
}

WorkerConfig describes a set of worker machines.

func (*WorkerConfig) Validate

func (m *WorkerConfig) Validate() error

Validate checks if the Config makes sense.

Jump to

Keyboard shortcuts

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