Skip to content

Commit b85026d

Browse files
committed
README
1 parent 1f5bd11 commit b85026d

1 file changed

Lines changed: 65 additions & 21 deletions

File tree

contrib/k8s-lbry/README.md

Lines changed: 65 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ cluster.
4040
+ [Startup chainquery with a database snapshot](#startup-chainquery-with-a-database-snapshot)
4141
* [lbrynet](#lbrynet)
4242
+ [IMPORTANT - Backup your cluster wallet](#important---backup-your-cluster-wallet)
43+
- [Uninstall](#uninstall)
4344

4445
<!-- tocstop -->
4546

@@ -95,7 +96,7 @@ You may also find [an older version of this same tutorial from before run.sh
9596
existed](https://github.com/EnigmaCurry/lbry-docker/blob/7bf2555e230aee6997c5192a98d716f8504a495a/contrib/k8s-lbry/README.md),
9697
it has a focus on using helm and kubectl directly. But after reading that, you
9798
may appreciate that the commands here are shorter, and easier to repeat. If you
98-
pay close attention to the output of `run.sh`, you will see that it prints out
99+
pay close attention to the output of [`run.sh`](run.sh), you will see that it prints out
99100
the full helm or kubectl commands as it runs them.
100101

101102
### Create a project directory
@@ -119,16 +120,19 @@ chmod a+x run.sh
119120

120121
### Setup alias and tab completion
121122

122-
`run.sh` can be run directly without any setup. However, setting a bash alias
123-
for `run.sh` is the quickest way of setting up to run from any directory, as
124-
well as activating support for bash tab completion.
123+
`run.sh` can be run directly without any setup. However, without adding it to
124+
your `PATH`, you need to specify the full path to the script each time. Setting
125+
a bash alias for `run.sh` is the quickest way of setting up to run from
126+
anywhere, as well as activating support for bash tab completion.
127+
128+
One time setup to install alias to `$HOME/.bashrc`:
125129

126130
```
127131
./run.sh setup-alias
128132
```
129133

130-
It should prompt you if it is OK to edit your `$HOME/.bashrc`. Once you confirm,
131-
close your terminal session, then reopen it.
134+
It should prompt you if it is OK for the script to edit `$HOME/.bashrc`. Once
135+
you confirm, close your terminal session, then reopen it.
132136

133137
Verify the new `k8s-lbry` alias to `run.sh` is working:
134138

@@ -140,8 +144,8 @@ Notice that tab completion should work throughout typing the above command.
140144

141145
### k8s-lbry setup
142146

143-
Setup will check for dependencies, update helm repositories, and creates an
144-
initial config file.
147+
Setup will check for dependencies, update helm repositories, and create an
148+
initial config file (`values-dev.yaml`).
145149

146150
```
147151
k8s-lbry setup
@@ -153,7 +157,7 @@ An Ingress Controller
153157
([nginx-ingress](https://github.com/helm/charts/tree/master/stable/nginx-ingress))
154158
will help you to route outside internet traffic into your cluster. nginx-ingress
155159
will also help terminate TLS connections (SSL) so that your containers don't
156-
need to worry about encryption.
160+
need to worry about encryption of traffic.
157161

158162
Install nginx-ingress into the `k8s-lbry` namespace:
159163

@@ -182,14 +186,15 @@ depending on what you enable in `values-dev.yaml`.
182186
Wait for the nginx-ingress Load Balancer to show an External IP address:
183187

184188
```
185-
k8s-lbry kubectl get svc
189+
k8s-lbry kubectl get svc -w
186190
```
187191

188192
Press Ctrl-C to quit once you see the External IP listed (and not `<pending>`).
189193

190-
You must create your own `values-dev.yaml` (or have told `run.sh setup` to
191-
create one for you), or to use a path other than `values-dev.yaml`, pass the
192-
`VALUES` environment variable to subsequent `run.sh` commands.
194+
You must edit your own `values-dev.yaml`. (The setup procedure created an
195+
initial configuration in the same directory as `run.sh`.) To use a different
196+
config file, set the `VALUES` environment variable before subsequent commands,
197+
specifying the full path to your values file.
193198

194199
Edit `values-dev.yaml`. Change the following things:
195200

@@ -201,7 +206,7 @@ Edit `values-dev.yaml`. Change the following things:
201206
* Change `echo-http-server.hostname` to any domain name you choose. (It must be
202207
a real internet domain that you control, if you choose to enable TLS.)
203208
* Each section has it's own `enabled` flag, to selectively turn on each
204-
service. It is recommended to start with only lbrycrd enabled, then enable
209+
service. It is recommended to start with only `lbrycrd` enabled, then enable
205210
other services as you need them by running `upgrade`.
206211

207212
Save `values-dev.yaml`.
@@ -214,10 +219,10 @@ k8s-lbry install
214219

215220
### k8s-lbry upgrade
216221

217-
For helm, upgrade does not necessarily mean you are upgrading to a new version
218-
of any particular software, it just means to apply your configuration file to
219-
the cluster. If you edit `values-dev.yaml`, you apply your changes with
220-
`k8s-lbry upgrade`.
222+
For helm, `upgrade` does not necessarily mean you are upgrading to a new version
223+
of any particular software, `upgrade` just means to apply your configuration
224+
file to the cluster. If you edit `values-dev.yaml`, you then need to apply your
225+
changes with `k8s-lbry upgrade`.
221226

222227
You can make changes to `values-dev.yaml` at any time. You can apply your
223228
configuration to your cluster by upgrading the release:
@@ -333,7 +338,7 @@ Run the mysql shell for the speech database.
333338

334339
#### k8s-lbry logs [app_name]
335340

336-
Stream the logs for a pod given the helm app name into your terminal.
341+
Stream the logs for a pod into your terminal, given the helm app name.
337342

338343
Example:
339344

@@ -385,8 +390,8 @@ k8s-lbry logs lbrycrd
385390

386391
Press Ctrl-C to stop viewing the log.
387392

388-
It is advisable to wait for lbrycrd to syncrhonize with the full blockchain
389-
before starting other services, so watch the logs until syncrhonization
393+
It is advisable to wait for lbrycrd to synchronize with the full blockchain
394+
before starting other services, so watch the logs until synchronization
390395
completes.
391396

392397
You can utilize `lbrycrd-cli` as well:
@@ -529,3 +534,42 @@ deposit LBC:
529534
k8s-lbry lbrynet address unused
530535
```
531536

537+
## Uninstall
538+
539+
If you wish to uninstall k8s-lbry from your cluster, here are the steps:
540+
541+
* Delete the helm releases:
542+
543+
```
544+
k8s-lbry helm delete k8s-lbry
545+
546+
k8s-lbry helm delete cert-manager
547+
548+
k8s-lbry helm delete nginx-ingress
549+
```
550+
551+
* By deleting the `nginx-ingress` release, the Load Balancer resource should
552+
be automatically cleaned up. You can verify this yourself in your cloud
553+
provider's console that no Load Balancer is still running.
554+
555+
* Delete the Persistent Volume Claims:
556+
557+
* In `values-dev.yaml` all of the persistence claims are labeled as
558+
`"helm.sh/resource-policy": keep`. This means that helm will not
559+
automatically delete the volume when it deletes the release.
560+
561+
* List all of your Persistent Volume Claims:
562+
563+
```
564+
k8s-lbry kubectl get pvc
565+
```
566+
567+
* Then delete each one you no longer want:
568+
569+
```
570+
k8s-lbry kubectl delete pvc [name-of-pvc]
571+
```
572+
573+
* Deleting the claim, should delete the volume. You can verify this yourself
574+
in your cloud provider's console that no Volumes exist.
575+

0 commit comments

Comments
 (0)