etcd

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2020 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Overview

Package etcd allows to create and manage etcd clusters.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromYaml

func FromYaml(c []byte) (types.Resource, error)

FromYaml allows to restore cluster state from YAML.

Types

type Cluster

type Cluster struct {
	// User-configurable fields.
	Image         string            `json:"image,omitempty"`
	SSH           *ssh.Config       `json:"ssh,omitempty"`
	CACertificate types.Certificate `json:"caCertificate,omitempty"`
	Members       map[string]Member `json:"members,omitempty"`

	// Serializable fields.
	State container.ContainersState `json:"state,omitempty"`
}

Cluster represents etcd cluster configuration and state from the user.

func (*Cluster) New

func (c *Cluster) New() (types.Resource, error)

New validates etcd cluster configuration and fills members with default and computed values.

func (*Cluster) Validate

func (c *Cluster) Validate() error

Validate validates Cluster configuration.

type Member

type Member struct {
	Name              string            `json:"name,omitempty"`
	Image             string            `json:"image,omitempty"`
	Host              host.Host         `json:"host,omitempty"`
	CACertificate     types.Certificate `json:"caCertificate,omitempty"`
	PeerCertificate   types.Certificate `json:"peerCertificate,omitempty"`
	PeerKey           types.PrivateKey  `json:"peerKey,omitempty"`
	PeerAddress       string            `json:"peerAddress,omitempty"`
	InitialCluster    string            `json:"initialCluster,omitempty"`
	PeerCertAllowedCN string            `json:"peerCertAllowedCN,omitempty"`
	ServerCertificate types.Certificate `json:"serverCertificate,omitempty"`
	ServerKey         types.PrivateKey  `json:"serverKey,omitempty"`
	ServerAddress     string            `json:"serverAddress,omitempty"`
	NewCluster        bool              `json:"newCluster,omitempty"`
}

Member represents single etcd member

func (*Member) New

func (m *Member) New() (container.ResourceInstance, error)

New validates Member configuration and returns it's usable version

func (*Member) Validate

func (m *Member) Validate() error

Validate validates etcd member configuration TODO add validation of certificates if specified

Jump to

Keyboard shortcuts

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