config

package
v0.1.0-beta0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2019 License: Apache-2.0 Imports: 5 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 BackupConfig

type BackupConfig struct {
	// Provider is provider for buckets and volume snapshots.
	// Possible values are: AWS (includes compatible AWS S3 storages), Azure and GCP
	// TODO(xmudrii): By default uses specified control plane provider if compatible with Ark
	Provider string `json:"provider"`

	// S3AccessKey is Access Key used to access backups S3 bucket.
	// This variable is sourced from BACKUP_AWS_ACCESS_KEY_ID,
	// or if unset from AWS_ACCESS_KEY_ID environment variable
	S3AccessKey string `json:"s3_access_key"`
	// S3SecretAccessKey is secret key used to access backups S3 bucket.
	// This variable is sourced from BACKUP_AWS_SECRET_ACCESS_KEY environment variable,
	// or if unset from AWS_SECRET_ACCESS_KEY environment variable
	S3SecretAccessKey string `json:"s3_secret_access_key"`

	// BucketName is name of the S3 bucket where backups are stored
	BucketName string `json:"bucket_name"`

	// BackupStorageConfig is optional configuration depending on the provider specified
	// Details: https://heptio.github.io/ark/v0.10.0/api-types/backupstoragelocation.html
	BackupStorageConfig map[string]string `json:"backup_storage_config"`

	// VolumesSnapshotConfig is optional configuration depending on the provider specified
	// Details: https://heptio.github.io/ark/v0.10.0/api-types/volumesnapshotlocation.html
	VolumesSnapshotConfig map[string]string `json:"volumes_snapshot_region"`
}

BackupConfig describes where and how to store Ark backups

func (*BackupConfig) ApplyEnvironment

func (m *BackupConfig) ApplyEnvironment() error

ApplyEnvironment reads credentials from environment variables, returning an error if a required variable is not set.

func (*BackupConfig) Enabled

func (m *BackupConfig) Enabled() bool

Enabled checks if a provider is set and Ark should be deployed.

func (*BackupConfig) Validate

func (m *BackupConfig) Validate() error

Validate valides the BackupConfig structure, ensuring credentials and bucket name are provided

type Cluster

type Cluster struct {
	Name              string                  `json:"name"`
	Hosts             []*HostConfig           `json:"hosts"`
	APIServer         APIServerConfig         `json:"apiserver"`
	ETCD              ETCDConfig              `json:"etcd"`
	Provider          ProviderConfig          `json:"provider"`
	Versions          VersionConfig           `json:"versions"`
	Network           NetworkConfig           `json:"network"`
	Workers           []WorkerConfig          `json:"workers"`
	Backup            BackupConfig            `json:"backup"`
	MachineController MachineControllerConfig `json:"machine_controller"`
}

Cluster describes our entire configuration.

func (*Cluster) DefaultAndValidate

func (m *Cluster) DefaultAndValidate() error

DefaultAndValidate checks if the cluster config makes sense.

func (*Cluster) EtcdClusterToken

func (m *Cluster) EtcdClusterToken() string

EtcdClusterToken returns the cluster name It must be deterministic across multiple runs

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 ETCDConfig

type ETCDConfig struct {
	Version string `json:"address"`
}

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.

func (*HostConfig) EtcdPeerURL

func (m *HostConfig) EtcdPeerURL() string

EtcdPeerURL with schema

func (*HostConfig) EtcdURL

func (m *HostConfig) EtcdURL() string

EtcdURL with schema

type MachineControllerConfig

type MachineControllerConfig struct {
	Deploy *bool `json:"deploy"`
}

func (*MachineControllerConfig) DefaultAndValidate

func (m *MachineControllerConfig) DefaultAndValidate() 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"`
	CloudConfig string            `json:"cloud_config"`
	Credentials map[string]string `json:"credentials"`
}

ProviderConfig describes the cloud provider that is running the machines.

func (*ProviderConfig) ApplyEnvironment

func (p *ProviderConfig) ApplyEnvironment() error

ApplyEnvironment reads cloud provider credentials from environment variables.

func (*ProviderConfig) Validate

func (p *ProviderConfig) Validate() error

Validate checks the ProviderConfig for errors

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

ProviderName values

func (ProviderName) CredentialsEnvironmentVariables

func (p ProviderName) CredentialsEnvironmentVariables() []string

type VersionConfig

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

VersionConfig describes the versions of Kubernetes and Docker that are installed.

func (*VersionConfig) Etcd

func (m *VersionConfig) Etcd() string

Etcd version

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