Documentation
¶
Index ¶
- Constants
- func GetEndpoints(ctx context.Context, resources state.State) ([]string, error)
- func WithLock(ctx context.Context, key string, logger *zap.Logger, f func() error) error
- type CertificateGenerator
- func (gen *CertificateGenerator) GenerateClientCert(commonName string) (*x509.PEMEncodedCertificateAndKey, error)
- func (gen *CertificateGenerator) GeneratePeerCert() (*x509.PEMEncodedCertificateAndKey, error)
- func (gen *CertificateGenerator) GenerateServerCert() (*x509.PEMEncodedCertificateAndKey, error)
- type Client
- func (c *Client) ForfeitLeadership(ctx context.Context) (string, error)
- func (c *Client) LeaveCluster(ctx context.Context) error
- func (c *Client) RemoveMember(ctx context.Context, hostname string) error
- func (c *Client) ValidateForUpgrade(ctx context.Context, config config.Provider, preserve bool) error
- func (c *Client) ValidateQuorum(ctx context.Context) (err error)
Constants ¶
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 GetEndpoints ¶ added in v1.2.0
GetEndpoints returns expected endpoints of etcd cluster members.
It is not guaranteed that etcd is running on each listed endpoint.
Types ¶
type CertificateGenerator ¶ added in v1.2.0
type CertificateGenerator struct { CA *x509.PEMEncodedCertificateAndKey NodeAddresses *network.NodeAddress HostnameStatus *network.HostnameStatus }
CertificateGenerator contains etcd certificate options.
func (*CertificateGenerator) GenerateClientCert ¶ added in v1.2.0
func (gen *CertificateGenerator) GenerateClientCert(commonName string) (*x509.PEMEncodedCertificateAndKey, error)
GenerateClientCert generates client certificate and key from etcd CA.
func (*CertificateGenerator) GeneratePeerCert ¶ added in v1.2.0
func (gen *CertificateGenerator) GeneratePeerCert() (*x509.PEMEncodedCertificateAndKey, error)
GeneratePeerCert generates etcd peer certificate and key from etcd CA.
func (*CertificateGenerator) GenerateServerCert ¶ added in v1.2.0
func (gen *CertificateGenerator) GenerateServerCert() (*x509.PEMEncodedCertificateAndKey, error)
GenerateServerCert generates server etcd certificate and key from etcd CA.
type Client ¶ added in v0.7.0
Client is a wrapper around the official etcd client.
func NewClient ¶
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
NewLocalClient initializes and returns etcd client configured to talk to localhost endpoint.
func (*Client) ForfeitLeadership ¶ added in v0.7.0
ForfeitLeadership transfers leadership from the current member to another member.
func (*Client) LeaveCluster ¶ added in v0.7.0
LeaveCluster removes the current member from the etcd cluster and nukes etcd data directory.
func (*Client) RemoveMember ¶ added in v0.9.0
RemoveMember removes the member from the etcd cluster.