Documentation ¶
Index ¶
- func CheckConfigurationIsHA(cfg *kubeadmapi.Etcd) bool
- func PodManifestsHaveTLS(ManifestDir string) (bool, error)
- type Client
- func (c Client) AddMember(name string, peerAddrs string) ([]Member, error)
- func (c Client) ClusterAvailable() (bool, error)
- func (c Client) GetClusterStatus() (map[string]*clientv3.StatusResponse, error)
- func (c Client) GetClusterVersions() (map[string]string, error)
- func (c Client) GetVersion() (string, error)
- func (c Client) HasTLS() bool
- func (c Client) Sync() error
- func (c Client) WaitForClusterAvailable(delay time.Duration, retries int, retryInterval time.Duration) (bool, error)
- type ClusterInterrogator
- type Member
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 InitConfiguration etcd block appears to be an HA configuration.
func PodManifestsHaveTLS ¶
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 ¶
Client provides connection parameters for an etcd cluster
func NewFromCluster ¶ added in v1.13.0
NewFromCluster creates an etcd client for the the etcd endpoints defined in the ClusterStatus value stored in the kubeadm-config ConfigMap in kube-system namespace. Once created, the client synchronizes client's endpoints with the known endpoints from the etcd membership API (reality check).
func (Client) AddMember ¶ added in v1.13.0
AddMember notifies an existing etcd cluster that a new member is joining
func (Client) ClusterAvailable ¶ added in v1.10.3
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
GetClusterVersions returns a map of the endpoints and their associated versions
func (Client) GetVersion ¶ added in v1.10.3
GetVersion returns the etcd version of the cluster. An error is returned if the version of all endpoints do not match
func (Client) Sync ¶ added in v1.13.0
Sync synchronizes client's endpoints with the known endpoints from the etcd membership.
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) Sync() error AddMember(name string, peerAddrs string) ([]Member, error) }
ClusterInterrogator is an interface to get etcd cluster related information