summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin SB <justinsb@google.com>2018-10-22 16:20:05 -0400
committerJustin SB <justinsb@google.com>2018-10-22 16:32:37 -0400
commit1a7d5d9776df992ef1c55e8e659c07cf73acc81e (patch)
tree7d64a7a8acd8d35cd400a45ee0a326faa8c0e80b
parent3005cd4324e34428c5c97735d4ef155a5c76eb92 (diff)
Add KEP for etcdadm
-rw-r--r--keps/NEXT_KEP_NUMBER2
-rw-r--r--keps/sig-cluster-lifecycle/0031-20181022-etcdadm.md179
2 files changed, 180 insertions, 1 deletions
diff --git a/keps/NEXT_KEP_NUMBER b/keps/NEXT_KEP_NUMBER
index e85087af..f5c89552 100644
--- a/keps/NEXT_KEP_NUMBER
+++ b/keps/NEXT_KEP_NUMBER
@@ -1 +1 @@
-31
+32
diff --git a/keps/sig-cluster-lifecycle/0031-20181022-etcdadm.md b/keps/sig-cluster-lifecycle/0031-20181022-etcdadm.md
new file mode 100644
index 00000000..4264f47b
--- /dev/null
+++ b/keps/sig-cluster-lifecycle/0031-20181022-etcdadm.md
@@ -0,0 +1,179 @@
+---
+kep-number: 31
+title: etcdadm
+authors:
+ - "@justinsb"
+owning-sig: sig-cluster-lifecycle
+#participating-sigs:
+#- sig-apimachinery
+reviewers:
+ - @roberthbailey
+ - @timothysc
+approvers:
+ - @roberthbailey
+ - @timothysc
+editor: TBD
+creation-date: 2018-10-22
+last-updated: 2018-10-22
+status: provisional
+#see-also:
+# - KEP-1
+# - KEP-2
+#replaces:
+# - KEP-3
+#superseded-by:
+# - KEP-100
+---
+
+# etcdadm - automation for etcd clusters
+
+## Table of Contents
+
+* [Table of Contents](#table-of-contents)
+* [Summary](#summary)
+* [Motivation](#motivation)
+ * [Goals](#goals)
+ * [Non-Goals](#non-goals)
+* [Proposal](#proposal)
+ * [User Stories](#user-stories)
+ * [Manual Cluster Creation](#manual-cluster-creation)
+ * [Automatic Cluster Creation](#automatic-cluster-creation)
+ * [Implementation Details/Notes/Constraints](#implementation-detailsnotesconstraints)
+ * [Risks and Mitigations](#risks-and-mitigations)
+* [Graduation Criteria](#graduation-criteria)
+* [Implementation History](#implementation-history)
+* [Infrastructure Needed](#infrastructure-needed)
+
+## Summary
+
+etcdadm makes operation of etcd for the Kubernetes control plane easy, on clouds
+and on bare-metal, including both single-node and HA configurations.
+
+It is able to perform cluster reconfigurations, upgrades / downgrades, and
+backups / restores.
+
+## Motivation
+
+Today each installation tool must reimplement etcd operation, and this is
+difficult. It also leads to ecosystem fragmentation - e.g. etcd backups from
+one tool are not necessarily compatible with the backups from other tools. The
+failure modes are subtle and rare, and thus the kubernetes project benefits from
+having more collaboration.
+
+
+### Goals
+
+The following key tasks are in scope:
+
+* Cluster creation
+* Cluster teardown
+* Cluster resizing / membership changes
+* Cluster backups
+* Disaster recovery or restore from backup
+* Cluster upgrades
+* Cluster downgrades
+* PKI management
+
+We will implement this functionality both as a base layer of imperative (manual
+CLI) operation, and a self-management layer which should enable automated
+in "safe" scenarios (with fallback to manual operation).
+
+### Non-Goals
+
+* The project is not targeted at operation of an etcd cluster for use other than
+ by Kubernetes apiserver. We are not building a general-purpose etcd operation
+ toolkit. Likely it will work well for other use-cases, but other tools may be
+ more suitable.
+
+## Proposal
+
+We will combine the [etcdadm](https://github.com/platform9/etcdadm) from
+Platform9 with the [etcd-manager](https://github.com/kopeio/etcd-manager)
+project from kopeio / @justinsb.
+
+etcdadm gives us easy to use CLI commands, which will form the base layer of
+operation. Automation should ideally describe what it is doing in terms of
+etcdadm commands, though we will also expose etcdadm as a go-library for easier
+consumption, following the kubectl pattern of a `cmd/` layer calling into a
+`pkg/` layer. This means the end-user can understand the operation of the
+tooling, and advanced users can feel confident that they can use the CLI tooling
+for advanced operations.
+
+etcd-manager provides automation of the common scenarios, particularly when
+running on a cloud. It will be rebased to work in terms of etcdadm CLI
+operations (which will likely require some functionality to be added to etcdadm
+itself). Where automation is not known to be safe, etcd-manager can stop and
+allow for manual intervention using the CLI.
+
+kops is currently using etcd-manager, and we aim to switch to the (new) etcadm asap.
+
+We expect other tooling (e.g. cluster-api implementations) to adopt this project
+for etcd management going forwards, and do a first integration or two if it
+hasn't happened already.
+
+### User Stories
+
+#### Manual Cluster Creation
+
+A cluster operator setting up a cluster manually will be able to do so using etcdadm and kubeadm.
+
+The basic flow looks like:
+
+* On a master machine, run `etcdadm init`, making note of the `etcdadm join
+ <endpoint>` command
+* On each other master machine, copy the CA certificate and key from one of the
+ other masters, then run the `etcdadm join <endpoint>` command.
+* Run kubeadm following the [external etcd procedure](https://kubernetes.io/docs/setup/independent/high-availability/#external-etcd)
+
+This results in an multi-node ("HA") etcd cluster.
+
+#### Automatic Cluster Creation
+
+etcd-manager works by coordinating via a shared filesystem-like store (e.g. S3
+or GCS) and/or via cloud APIs (e.g. EC2 or GCE). In doing so it is able to
+automate the manual commands, which is very handy for running in a cloud
+environment like AWS or GCE.
+
+The basic flow would look like:
+
+* The user writes a configuration file to GCS using `etcdadm seed
+ gs://mybucket/cluster1/etcd1 version=3.2.12 nodes=3`
+* On each master machine, run `etcdadm auto gs://mybucket/cluster1/etcd1`.
+ (Likely the user will have to run that persistently, either as a systemd
+ service or a static pod.)
+
+`etcdadm auto` downloads the target configuration from GCS, discovers other
+peers also running etcdadm, gossips with them to do basic leader election. When
+sufficient nodes are available to form a quorum, it starts etcd.
+
+### Implementation Details/Notes/Constraints
+
+* There will be some changes needed to both platform9/etcdadm (e.g. etcd2
+ support) and kopeio/etcd-manager (to rebase on top of etcdadm).
+* It is unlikely that e.g. GKE / EKS will use etcdadm (at least initially),
+ which limits the pool of contributors.
+
+### Risks and Mitigations
+
+* Automatic mode may make incorrect decisions and break a cluster. Mitigation:
+ automated backups, and a willingness to stop and wait for a fix / operator
+ intervention (CLI mode).
+* Automatic mode relies on peer-to-peer discovery and gossiping, which is less
+ reliable than Raft. Mitigation: rely on Raft as much as possible, be very
+ conservative in automated operations (favor correctness over availability or
+ speed). etcd non-voting members will make this much more reliable.
+
+## Graduation Criteria
+
+etcdadm will be considered successful when it is used by the majority of OSS
+cluster installations.
+
+## Implementation History
+
+* Much SIG discussion
+* Initial proposal to SIG 2018-10-09
+* Initial KEP draft 2018-10-22
+
+## Infrastructure Needed
+
+* etcdadm will be a subproject under sig-cluster-lifecycle