Documentation ¶
Index ¶
- func CreateDataDirectory(dir string) error
- func GetClientURL(localEndpoint *kubeadmapi.APIEndpoint) string
- func GetClientURLByIP(ip string) string
- func GetPeerURL(localEndpoint *kubeadmapi.APIEndpoint) string
- type Client
- func (c *Client) AddMember(name string, peerAddrs string) ([]Member, error)
- func (c *Client) CheckClusterHealth() error
- func (c *Client) GetMemberID(peerURL string) (uint64, error)
- func (c *Client) ListMembers() ([]Member, error)
- func (c *Client) RemoveMember(id uint64) ([]Member, error)
- func (c *Client) Sync() error
- func (c *Client) WaitForClusterAvailable(retries int, retryInterval time.Duration) (bool, error)
- type ClusterInterrogator
- type Member
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDataDirectory ¶ added in v1.20.0
CreateDataDirectory creates the etcd data directory (commonly /var/lib/etcd) with the right permissions.
func GetClientURL ¶ added in v1.13.0
func GetClientURL(localEndpoint *kubeadmapi.APIEndpoint) string
GetClientURL creates an HTTPS URL that uses the configured advertise address and client port for the API controller
func GetClientURLByIP ¶ added in v1.13.0
GetClientURLByIP creates an HTTPS URL based on an IP address and the client listening port.
func GetPeerURL ¶ added in v1.13.0
func GetPeerURL(localEndpoint *kubeadmapi.APIEndpoint) string
GetPeerURL creates an HTTPS URL that uses the configured advertise address and peer port for the API controller
Types ¶
type Client ¶
Client provides connection parameters for an etcd cluster
func NewFromCluster ¶ added in v1.13.0
NewFromCluster creates an etcd client for the etcd endpoints present in etcd member list. In order to compose this information, it will first discover at least one etcd endpoint to connect to. Once created, the client synchronizes client's endpoints with the known endpoints from the etcd membership API, since it is the authoritative source of truth for the list of available members.
func (*Client) AddMember ¶ added in v1.13.0
AddMember notifies an existing etcd cluster that a new member is joining, and return the updated list of members. If the member has already been added to the cluster, this will return the existing list of etcd members.
func (*Client) CheckClusterHealth ¶ added in v1.17.0
CheckClusterHealth returns nil for status Up or error for status Down
func (*Client) GetMemberID ¶ added in v1.14.0
GetMemberID returns the member ID of the given peer URL
func (*Client) ListMembers ¶ added in v1.17.9
ListMembers returns the member list.
func (*Client) RemoveMember ¶ added in v1.14.0
RemoveMember notifies an etcd cluster to remove an existing member
type ClusterInterrogator ¶ added in v1.10.3
type ClusterInterrogator interface { CheckClusterHealth() error WaitForClusterAvailable(retries int, retryInterval time.Duration) (bool, error) Sync() error ListMembers() ([]Member, error) AddMember(name string, peerAddrs string) ([]Member, error) GetMemberID(peerURL string) (uint64, error) RemoveMember(id uint64) ([]Member, error) }
ClusterInterrogator is an interface to get etcd cluster related information