etcd

package
v1.11.8 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckConfigurationIsHA added in v1.11.0

func CheckConfigurationIsHA(cfg *kubeadmapi.Etcd) bool

CheckConfigurationIsHA returns true if the given MasterConfiguration etcd block appears to be an HA configuration.

func PodManifestsHaveTLS

func PodManifestsHaveTLS(ManifestDir string) (bool, error)

PodManifestsHaveTLS reads the etcd staticpod manifest from disk and returns false if the TLS flags are missing from the command list. If all the flags are present it returns true.

Types

type Client

type Client struct {
	Endpoints []string
	TLS       *tls.Config
}

Client provides connection parameters for an etcd cluster

func New added in v1.10.3

func New(endpoints []string, ca, cert, key string) (*Client, error)

New creates a new EtcdCluster client

func NewFromStaticPod added in v1.10.3

func NewFromStaticPod(endpoints []string, manifestDir string, certificatesDir string) (*Client, error)

NewFromStaticPod creates a GenericClient from the given endpoints, manifestDir, and certificatesDir

func (Client) ClusterAvailable added in v1.10.3

func (c Client) ClusterAvailable() (bool, error)

ClusterAvailable returns true if the cluster status indicates the cluster is available.

func (Client) GetClusterStatus added in v1.10.3

func (c Client) GetClusterStatus() (map[string]*clientv3.StatusResponse, error)

GetClusterStatus returns nil for status Up or error for status Down

func (Client) GetClusterVersions added in v1.10.3

func (c Client) GetClusterVersions() (map[string]string, error)

GetClusterVersions returns a map of the endpoints and their associated versions

func (Client) GetVersion added in v1.10.3

func (c Client) GetVersion() (string, error)

GetVersion returns the etcd version of the cluster. An error is returned if the version of all endpoints do not match

func (Client) HasTLS

func (c Client) HasTLS() bool

HasTLS returns true if etcd is configured for TLS

func (Client) WaitForClusterAvailable added in v1.10.3

func (c Client) WaitForClusterAvailable(delay time.Duration, retries int, retryInterval time.Duration) (bool, error)

WaitForClusterAvailable returns true if all endpoints in the cluster are available after an initial delay and retry attempts, an error is returned otherwise

type ClusterInterrogator added in v1.10.3

type ClusterInterrogator interface {
	ClusterAvailable() (bool, error)
	GetClusterStatus() (map[string]*clientv3.StatusResponse, error)
	GetClusterVersions() (map[string]string, error)
	GetVersion() (string, error)
	HasTLS() bool
	WaitForClusterAvailable(delay time.Duration, retries int, retryInterval time.Duration) (bool, error)
}

ClusterInterrogator is an interface to get etcd cluster related information

Jump to

Keyboard shortcuts

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