etcd

package
v1.2.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2022 License: MPL-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const QuorumCheckTimeout = 15 * time.Second

QuorumCheckTimeout is the amount of time to allow for KV operations before quorum is declared invalid.

Variables

This section is empty.

Functions

func GenerateCert added in v0.11.0

GenerateCert generates etcd certificate and key from etcd CA.

func GenerateClientCert added in v0.11.0

func GenerateClientCert(etcdCA *x509.PEMEncodedCertificateAndKey, commonName string) (*x509.PEMEncodedCertificateAndKey, error)

GenerateClientCert generates client certificate and key from etcd CA.

func GeneratePeerCert added in v0.9.0

GeneratePeerCert generates etcd peer certificate and key from etcd CA.

func NewCommonOptions added in v0.11.0

func NewCommonOptions() ([]x509.Option, error)

NewCommonOptions set common certificate options.

Types

type Client added in v0.7.0

type Client struct {
	*clientv3.Client
}

Client is a wrapper around the official etcd client.

func NewClient

func NewClient(endpoints []string) (client *Client, err error)

NewClient initializes and returns an etcd client configured to talk to a list of endpoints.

func NewClientFromControlPlaneIPs

func NewClientFromControlPlaneIPs(ctx context.Context, resources state.State) (client *Client, err error)

NewClientFromControlPlaneIPs initializes and returns an etcd client configured to talk to all members.

func NewLocalClient added in v0.9.0

func NewLocalClient() (client *Client, err error)

NewLocalClient initializes and returns etcd client configured to talk to localhost endpoint.

func (*Client) ForfeitLeadership added in v0.7.0

func (c *Client) ForfeitLeadership(ctx context.Context) (string, error)

ForfeitLeadership transfers leadership from the current member to another member.

func (*Client) LeaveCluster added in v0.7.0

func (c *Client) LeaveCluster(ctx context.Context) error

LeaveCluster removes the current member from the etcd cluster and nukes etcd data directory.

func (*Client) RemoveMember added in v0.9.0

func (c *Client) RemoveMember(ctx context.Context, hostname string) error

RemoveMember removes the member from the etcd cluster.

func (*Client) ValidateForUpgrade added in v0.7.0

func (c *Client) ValidateForUpgrade(ctx context.Context, config config.Provider, preserve bool) error

ValidateForUpgrade validates the etcd cluster state to ensure that performing an upgrade is safe.

func (*Client) ValidateQuorum added in v0.7.0

func (c *Client) ValidateQuorum(ctx context.Context) (err error)

ValidateQuorum performs a KV operation to make certain that quorum is good.

Jump to

Keyboard shortcuts

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