Documentation
¶
Overview ¶
Package config implements the KubeOne configuration API. Deprecated: This API is deprecated and is used only for migration purposes. The config package will be removed after 2019-08-12.
Index ¶
- Constants
- func MigrateToKubeOneClusterAPI(oldConfigPath string) (interface{}, error)
- type APIServerConfig
- type Cluster
- type DynamicAuditLog
- type Features
- type HostConfig
- type MachineControllerConfig
- type MetricsServer
- type NetworkConfig
- type OpenIDConnect
- type OpenIDConnectConfig
- type PodSecurityPolicy
- type ProviderConfig
- type ProviderEnvironmentVariable
- type ProviderName
- type ProxyConfig
- type VersionConfig
- type WorkerConfig
Constants ¶
const ( AWSAccessKeyID = "AWS_ACCESS_KEY_ID" AWSSecretAccessKey = "AWS_SECRET_ACCESS_KEY" DigitalOceanTokenKey = "DO_TOKEN" GoogleServiceAccountKey = "GOOGLE_SERVICE_ACCOUNT" HetznerTokenKey = "HZ_TOKEN" OpenStackAuthURL = "OS_AUTH_URL" OpenStackDomainName = "OS_DOMAIN_NAME" OpenStackPassword = "OS_PASSWORD" OpenStackTenantName = "OS_TENANT_NAME" OpenStackUserName = "OS_USER_NAME" PacketAPIKey = "PACKET_API_KEY" PacketProjectID = "PACKET_PROJECT_ID" VSphereAddress = "VSPHERE_ADDRESS" VSpherePasswords = "VSPHERE_PASSWORD" VSphereUsername = "VSPHERE_USERNAME" )
ENV variable names with credential in them that machine-controller expects to see
Variables ¶
This section is empty.
Functions ¶
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 ¶
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 DynamicAuditLog ¶ added in v0.8.0
type DynamicAuditLog struct {
Enable *bool `json:"enable,omitempty"`
}
DynamicAuditLog feature flag
type Features ¶ added in v0.4.0
type Features struct {
PodSecurityPolicy PodSecurityPolicy `json:"pod_security_policy"`
DynamicAuditLog DynamicAuditLog `json:"dynamic_audit_log"`
MetricsServer MetricsServer `json:"metrics_server"`
OpenIDConnect OpenIDConnect `json:"openid_connect"`
}
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 MetricsServer ¶ added in v0.8.0
type MetricsServer struct {
Enable *bool `json:"enable,omitempty"`
}
MetricsServer feature flag
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 OpenIDConnect ¶ added in v0.8.0
type OpenIDConnect struct {
Enable bool `json:"enable"`
Config OpenIDConnectConfig `json:"config"`
}
OpenIDConnect feature flag
type OpenIDConnectConfig ¶ added in v0.8.0
type OpenIDConnectConfig struct {
IssuerURL string `json:"issuer_url"`
ClientID string `json:"client_id"`
UsernameClaim string `json:"username_claim"`
UsernamePrefix string `json:"username_prefix"`
GroupsClaim string `json:"groups_claim"`
GroupsPrefix string `json:"groups_prefix"`
RequiredClaim string `json:"required_claim"`
SigningAlgs string `json:"signing_algs"`
CAFile string `json:"ca_file"`
}
OpenIDConnectConfig config
type PodSecurityPolicy ¶ added in v0.8.0
type PodSecurityPolicy struct {
Enable *bool `json:"enable,omitempty"`
}
PodSecurityPolicy feature flag
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
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 = "vsphere" ProviderNameGCE ProviderName = "gce" ProviderNamePacket ProviderName = "packet" 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.
Source Files
¶
- cluster.go
- migrate.go