package etcd
import "k8s.io/kubernetes/cmd/kubeadm/app/util/etcd"
Index ¶
- func CheckConfigurationIsHA(cfg *kubeadmapi.Etcd) bool
- func PodManifestsHaveTLS(ManifestDir string) (bool, error)
- type Client
- func New(endpoints []string, ca, cert, key string) (*Client, error)
- func NewFromStaticPod(endpoints []string, manifestDir string, certificatesDir string) (*Client, 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) WaitForClusterAvailable(delay time.Duration, retries int, retryInterval time.Duration) (bool, error)
- type ClusterInterrogator
Functions ¶
func CheckConfigurationIsHA ¶
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 New ¶
New creates a new EtcdCluster client
func NewFromStaticPod ¶
func NewFromStaticPod(endpoints []string, manifestDir string, certificatesDir string) (*Client, error)
NewFromStaticPod creates a GenericClient from the given endpoints, manifestDir, and certificatesDir
func (Client) ClusterAvailable ¶
ClusterAvailable returns true if the cluster status indicates the cluster is available.
func (Client) GetClusterStatus ¶
func (c Client) GetClusterStatus() (map[string]*clientv3.StatusResponse, error)
GetClusterStatus returns nil for status Up or error for status Down
func (Client) GetClusterVersions ¶
GetClusterVersions returns a map of the endpoints and their associated versions
func (Client) GetVersion ¶
GetVersion returns the etcd version of the cluster. An error is returned if the version of all endpoints do not match
func (Client) HasTLS ¶
HasTLS returns true if etcd is configured for TLS
func (Client) WaitForClusterAvailable ¶
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 ¶
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
Source Files ¶
etcd.go
- Version
- v1.12.6
- Published
- Feb 26, 2019
- Platform
- js/wasm
- Imports
- 11 packages
- Last checked
- 30 minutes ago –
Tools for package owners.