kopeio / etcd-manager

operator for etcd: moved to https://github.com/kubernetes-sigs/etcdadm
Apache License 2.0
164 stars 47 forks source link

Archived: moved to etcdadm kubernetes project

This repository is now part of the kubernetes project; development continues at https://github.com/kubernetes-sigs/etcdadm.

Please continue to contribute bugs / PRs / questions there!


etcd-manager

etcd-manager manages an etcd cluster, on a cloud or on bare-metal.

It borrows from the ideas of the etcd-operator, but avoids the circular dependency of relying on kubernetes (which itself relies on etcd).

etcd-manager performs a minimal amount of gossip-like discovery of peers for initial cluster membership, then "pivots to etcd" as soon as possible. etcd-manager also watches for peer membership changes to manage the correct number of members for the desired cluster quorum. Actual cluster membership changes to etcd continue to take place through raft.

Communication with etcd-manager happens via the etcd-manager-ctl binary.

A walkthrough of the process of setting up a cluster for local development can be found here.

Backups

The etcd-manager leader periodically backs up etcd snapshots to a backup store, in addition to automatically triggering an backup before cluster-modification operations.

Cluster changes that are not normally supported can be done safely through etcd backups & restore.

The format of the backup store, which is intended to be project-neutral is here.

Code overview

etcd-host

etcd-manager-ctl

Supported Commands:

get             Shows Cluster Spec
configure-cluster       Sets cluster spec based on -member-count and -etcd-version args specified.
list-backups            List backups available in the -backup-store
list-commands           List commands in queue for cluster to execute.
delete-command          Deletes a command from the clusters queue
restore-backup          Restores the backup specified. Pass the backup timestamp shown by list-backup as parameter.
                eg. etcd-ctl -backup-store=s3://mybackupstore/ restore-backup 2019-05-07T18:28:01Z-000977

etcd-manager

Leader Election Overview

Leader Control Loop

Once a leader has been determined, it performs this basic loop:

Current shortcomings

Help gratefully received: