Skip to content
This repository has been archived by the owner on Mar 28, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1652 from fanminshi/cleanup_readme
Browse files Browse the repository at this point in the history
readme: remove reference to old backup/restore
  • Loading branch information
fanminshi authored Nov 10, 2017
2 parents a57113f + b5bf1f0 commit bc37745
Showing 1 changed file with 3 additions and 81 deletions.
84 changes: 3 additions & 81 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@ The etcd operator manages etcd clusters deployed to [Kubernetes][k8s-home] and a

- [Create and destroy](#create-and-destroy-an-etcd-cluster)
- [Resize](#resize-an-etcd-cluster)
- [Recover a member](#member-recovery)
- [Backup and restore a cluster](#disaster-recovery)
- [Failover](#failover)
- [Rolling upgrade](#upgrade-an-etcd-cluster)

There are [more spec examples](./doc/user/spec_examples.md) on setting up clusters with backup, restore, and other configurations.
There are [more spec examples](./doc/user/spec_examples.md) on setting up clusters with different configurations

Read [Best Practices](./doc/best_practices.md) for more information on how to better use etcd operator.

Expand Down Expand Up @@ -143,7 +142,7 @@ example-etcd-cluster-0003 1/1 Running 0 1m
example-etcd-cluster-0004 1/1 Running 0 1m
```

## Member recovery
## Failover

If the minority of etcd members crash, the etcd operator will automatically recover the failure.
Let's walk through in the following steps.
Expand Down Expand Up @@ -207,79 +206,6 @@ example-etcd-cluster-0002 1/1 Running 0 1m
example-etcd-cluster-0003 1/1 Running 0 1m
```

## Disaster recovery

> 🚨 Backup is currently only supported with etcd v3 API data. Any data stored using the etcd v2 API will **not** be backed up.
If the majority of etcd members crash, but at least one backup exists for the cluster, the etcd operator can restore the entire cluster from the backup.

Before creating a backup enabled cluster you will need a storage class for the backup spec. For example create a storage class that provisions a GCEPersistentDisk:

```
$ kubectl create -f example/example-storage-class-gce-pd.yaml
$ kubectl get storageclass
NAME TYPE
etcd-backup-gce-pd kubernetes.io/gce-pd
```

This is used to request the persistent volume to store the backup data. See [other backup options](doc/user/backup_config.md).

To enable backup, create an etcd cluster with [backup enabled spec](example/example-etcd-cluster-with-backup.yaml) that specifies the above storage class name.

```
$ kubectl create -f example/example-etcd-cluster-with-backup.yaml
```

A persistent volume claim is created for the backup pod:

```
$ kubectl get pvc
NAME STATUS VOLUME CAPACITY ACCESSMODES AGE
example-etcd-cluster-with-backup-pvc Bound pvc-79e39bab-b973-11e6-8ae4-42010af00002 1Gi RWO 9s
```

Let's try to write some data into etcd:

```
$ kubectl run --rm -i --tty fun --image quay.io/coreos/etcd --restart=Never -- /bin/sh
/ # ETCDCTL_API=3 etcdctl --endpoints http://example-etcd-cluster-with-backup-client:2379 put foo bar
OK
(ctrl-D to exit)
```

Now let's kill two pods to simulate a disaster failure:

```
$ kubectl delete pod example-etcd-cluster-with-backup-0000 example-etcd-cluster-with-backup-0001 --now
pod "example-etcd-cluster-with-backup-0000" deleted
pod "example-etcd-cluster-with-backup-0001" deleted
```

Now quorum is lost. The etcd operator will start to recover the cluster by:
- Creating a new seed member to recover from the backup
- Add more members until the size reaches to specified number

```
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
example-etcd-cluster-with-backup-0003 0/1 Init:0/2 0 11s
example-etcd-cluster-with-backup-backup-sidecar-e9gkv 1/1 Running 0 18m
...
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
example-etcd-cluster-with-backup-0003 1/1 Running 0 3m
example-etcd-cluster-with-backup-0004 1/1 Running 0 3m
example-etcd-cluster-with-backup-0005 1/1 Running 0 3m
example-etcd-cluster-with-backup-backup-sidecar-e9gkv 1/1 Running 0 22m
```

Finally, besides destroying the cluster, also cleanup the backup if you don't need it anymore:
```
$ kubectl delete pvc example-etcd-cluster-with-backup-pvc
```

Note: There could be a race that it will fall to single member recovery if a pod is recovered before another is deleted.

## Upgrade an etcd cluster

Have the following yaml file ready:
Expand Down Expand Up @@ -345,10 +271,6 @@ Check the other two pods and you should see the same result.

- The etcd operator only manages the etcd cluster created in the same namespace. Users need to create multiple operators in different namespaces to manage etcd clusters in different namespaces.

- Backup works only for data in etcd3 storage, not for data in etcd2 storage.

- PV Backup only works on GCE(kubernetes.io/gce-pd) and AWS(kubernetes.io/aws-ebs) for now.

- Migration, the process of allowing the etcd operator to manage existing etcd3 clusters, only supports a single-member cluster, with its node running in the same Kubernetes cluster.


Expand Down

0 comments on commit bc37745

Please sign in to comment.