<commit_before># etcd backup operator

## Overview

etcd backup operator backups the data of a etcd cluster running on [Kubernetes][Kube] to a remote storage such as AWS [S3][s3].

## Getting Started

Try out etcd backup operator by running it on Kubernetes and then create a `EtcdBackup` Custom Resource which contains the targeting etcd cluster and S3 backup config; the etcd backup operator automatically picks up the `EtcdBackup` Custom Resource, retrieves etcd snapshot, and then saves it to S3.
>Note: The demo uses the `default` namespace.

Prerequisites: 
* access to a Kubernetes environment.
* see [Instruction][etcd_cluster_deploy] to deploy an etcd cluster. 

### Deploy etcd restore operator

Once `example-etcd-cluster` is running, let's create a backup for `example-etcd-cluster` using etcd backup operator. 

First, deploy an etcd backup operator:
> Note: etcd backup operator also creates EtcdBackup CRD when starting.

```sh
$ kubectl create -f example/etcd-backup-operator/deployment.yaml
$ kubectl get pod
NAME                                    READY     STATUS    RESTARTS   AGE
etcd-backup-operator-1102130733-hhgt7   1/1       Running   0          3s
```

### Create AWS Secret

Then, create an Kubernetes secret that contains aws config/credential; etcd operator uses the secret to gain access to S3 in order to save the etcd snapshot.

Verify that the local aws config and credentials files exist:
```sh
$ cat $AWS_DIR/credentials
[default]
aws_access_key_id = XXX
aws_secret_access_key = XXX

$ cat $AWS_DIR/config
[default]
region = <region>
```

Create kubernetes secret `aws`:

`kubectl create secret generic aws --from-file=$AWS_DIR/credentials --from-file=$AWS_DIR/config`<commit_msg>readme: fix typos in backup-operator/README.md<commit_after># etcd backup operator

## Overview

etcd backup operator backups the data of a etcd cluster running on [Kubernetes][Kube] to a remote storage such as AWS [S3][s3].

## Getting Started

Try out etcd backup operator by running it on Kubernetes and then create a `EtcdBackup` Custom Resource which contains the targeting etcd cluster and S3 backup config; the etcd backup operator automatically picks up the `EtcdBackup` Custom Resource, retrieves etcd snapshot, and then saves it to S3.
>Note: The demo uses the `default` namespace.

Prerequisites: 
* access to a Kubernetes environment.
* see [Instruction][etcd_cluster_deploy] to deploy an etcd cluster. 

### Deploy etcd backup operator

Once `example-etcd-cluster` is running, let's create a backup for `example-etcd-cluster` using etcd backup operator. 

First, deploy an etcd backup operator:
> Note: etcd backup operator also creates EtcdBackup CRD when starting.

```sh
$ kubectl create -f example/etcd-backup-operator/deployment.yaml
$ kubectl get pod
NAME                                    READY     STATUS    RESTARTS   AGE
etcd-backup-operator-1102130733-hhgt7   1/1       Running   0          3s
```

### Create AWS Secret

Create a Kubernetes secret that contains aws config/credential; etcd backup operator uses the secret to gain access to S3 in order to save the etcd snapshot.

Verify that the local aws config and credentials files exist:
```sh
$ cat $AWS_DIR/credentials
[default]
aws_access_key_id = XXX
aws_secret_access_key = XXX

$ cat $AWS_DIR/config
[default]
region = <region>
```

Create kubernetes secret `aws`:

`kubectl create secret generic aws --from-file=$AWS_DIR/credentials --from-file=$AWS_DIR/config`
{'fraction_non_alphanumeric': 0.07188221709006928, 'fraction_numerical': 0.011547344110854504, 'mean_word_length': 4.036337209302325, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2825961', 'n_tokens_mistral': 1040, 'n_tokens_neox': 1003, 'n_words': 423}