kubernetes: k8s.io/kubernetes/cmd/kubeadm/app/util/etcd Index | Files

package etcd

import "k8s.io/kubernetes/cmd/kubeadm/app/util/etcd"

Index

Package Files

etcd.go

func CheckConfigurationIsHA Uses

func CheckConfigurationIsHA(cfg *kubeadmapi.Etcd) bool

CheckConfigurationIsHA returns true if the given InitConfiguration etcd block appears to be an HA configuration.

func GetClientURL Uses

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 Uses

func GetClientURLByIP(ip string) string

GetClientURLByIP creates an HTTPS URL based on an IP address and the client listening port.

func GetPeerURL Uses

func GetPeerURL(localEndpoint *kubeadmapi.APIEndpoint) string

GetPeerURL creates an HTTPS URL that uses the configured advertise address and peer port for the API controller

type Client Uses

type Client struct {
    Endpoints []string
    TLS       *tls.Config
}

Client provides connection parameters for an etcd cluster

func New Uses

func New(endpoints []string, ca, cert, key string) (*Client, error)

New creates a new EtcdCluster client

func NewFromCluster Uses

func NewFromCluster(client clientset.Interface, certificatesDir string) (*Client, error)

NewFromCluster creates an etcd client for 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 Uses

func (c *Client) AddMember(name string, peerAddrs string) ([]Member, error)

AddMember notifies an existing etcd cluster that a new member is joining

func (*Client) CheckClusterHealth Uses

func (c *Client) CheckClusterHealth() error

CheckClusterHealth returns nil for status Up or error for status Down

func (*Client) GetClusterVersions Uses

func (c *Client) GetClusterVersions() (map[string]string, error)

GetClusterVersions returns a map of the endpoints and their associated versions

func (*Client) GetMemberID Uses

func (c *Client) GetMemberID(peerURL string) (uint64, error)

GetMemberID returns the member ID of the given peer URL

func (*Client) GetVersion Uses

func (c *Client) GetVersion() (string, error)

GetVersion returns the etcd version of the cluster. An error is returned if the version of all endpoints do not match

func (*Client) RemoveMember Uses

func (c *Client) RemoveMember(id uint64) ([]Member, error)

RemoveMember notifies an etcd cluster to remove an existing member

func (*Client) Sync Uses

func (c *Client) Sync() error

Sync synchronizes client's endpoints with the known endpoints from the etcd membership.

func (*Client) WaitForClusterAvailable Uses

func (c *Client) WaitForClusterAvailable(retries int, retryInterval time.Duration) (bool, error)

WaitForClusterAvailable returns true if all endpoints in the cluster are available after retry attempts, an error is returned otherwise

type ClusterInterrogator Uses

type ClusterInterrogator interface {
    CheckClusterHealth() error
    GetClusterVersions() (map[string]string, error)
    GetVersion() (string, error)
    WaitForClusterAvailable(retries int, retryInterval time.Duration) (bool, error)
    Sync() 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

type Member Uses

type Member struct {
    Name    string
    PeerURL string
}

Member struct defines an etcd member; it is used for avoiding to spread github.com/coreos/etcd dependency across kubeadm codebase

Package etcd imports 18 packages (graph) and is imported by 9 packages. Updated 2019-09-13. Refresh now. Tools for package owners.