Skip to content

Commit

Permalink
Update reattach-pv README (#6122)
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Montgomery <mmontg1@gmail.com>
  • Loading branch information
thbkrkr and naemono authored Oct 27, 2022
1 parent a3ed8a8 commit d11f532
Showing 1 changed file with 4 additions and 34 deletions.
38 changes: 4 additions & 34 deletions support/reattach-pv/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,49 +30,19 @@ Flags:
--old-elasticsearch-name string name of previous Elasticsearch cluster (to use existing volumes)
```

Example:
Example assuming cluster-A was accidently deleted:

```
# build the binary with a recent Go version
go build
# re-create the cluster with the same name
./reattach-pv --elasticsearch-manifest elasticsearch.yml --dry-run
./reattach-pv --elasticsearch-manifest cluster-A.yml --dry-run
# optionally re-create the cluster with a new name
reattach-pv --elasticsearch-manifest cluster-B.yml --old-elasticsearch-name cluster-A --dry-run
# or re-create the cluster with a new name
./reattach-pv --elasticsearch-manifest cluster-B.yml --old-elasticsearch-name cluster-A --dry-run
# if everything seems ok, execute one of the 2 previous commands again without the dry-run flag
# (or optionally with the --old-elasticsearch-name flag)
./reattach-pv --elasticsearch-manifest elasticsearch.yml
```

### To create a new cluster, with a new name, from a previously deleted cluster

```
Create a newly-named Elasticsearch cluster by reattaching existing released PersistentVolumes
Usage:
reattach-pv [flags]
Flags:
--dry-run do not apply any Kubernetes resource change
--elasticsearch-manifest string path pointing to the Elasticsearch yaml manifest
-h, --help help for reattach-pv
--old-elasticsearch-name string name of previous Elasticsearch cluster (to use existing volumes)
```

Example assuming `clusterA` was accidently deleted, then re-created with new data volumes, and is in use.
Previous PersistentVolumes for `clusterA` still exist, and will be used to build `clusterB`.

```
# build the binary with a recent Go version
go build
# perform a dry run first
# elasticsearch.yaml contains newly-named cluster (ex: `clusterB`)
./reattach-pv --elasticsearch-manifest elasticsearch.yml --dry-run --old-elasticsearch-name clusterA
# then, execute again without the dry-run flag
./reattach-pv --elasticsearch-manifest elasticsearch.yml --old-elasticsearch-name clusterA
```

## How it works
Expand Down

0 comments on commit d11f532

Please sign in to comment.