Skip to content

Commit a66499b

Browse files
authored
Merge pull request #10 from travisperson/docs/clean-up-development
docs: clean up development doc
2 parents 814ed65 + c8d9812 commit a66499b

File tree

1 file changed

+44
-44
lines changed

1 file changed

+44
-44
lines changed

docs/DEVELOPMENT.md

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ running on k8s somewhere, but is not covered here.
1010

1111
[Deploy MinIO on Docker Compose](https://docs.min.io/docs/deploy-minio-on-docker-compose.html)
1212

13-
This document is not step by step instruction, but provides the large parts. At the end you will have:
13+
This document is not step by step instructions, but provides the large parts. At the end you will have:
1414

1515
- kind k8s local cluster
1616
- minio bucket
@@ -44,14 +44,14 @@ usage as required to setup the development environment.
4444

4545
Install the minio plugin:
4646

47-
```
47+
```shell
4848
kubectl krew update
4949
kubectl krew install minio
5050
```
5151

5252
Add required helm chart repositories:
5353

54-
```
54+
```shell
5555
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
5656
helm repo add filecoin https://filecoin-project.github.io/helm-charts
5757
helm repo update
@@ -63,8 +63,8 @@ helm repo update
6363

6464
Create a cluster with three worker nodes.
6565

66-
```
67-
$ cat > cluster.yaml <<EOF
66+
```yaml
67+
# cluster.yaml
6868
kind: Cluster
6969
apiVersion: kind.x-k8s.io/v1alpha4
7070
nodes:
@@ -74,8 +74,8 @@ nodes:
7474
- role: worker
7575
EOF
7676
```
77-
```
78-
$ kind create cluster --config cluster.yaml
77+
```shell
78+
kind create cluster --config cluster.yaml
7979
```
8080

8181
#### Moving Container Images
@@ -84,8 +84,8 @@ $ kind create cluster --config cluster.yaml
8484

8585
When building the docker container, you will need to move it into the cluster. Kind provides an easy way to do this.
8686

87-
```
88-
$ kind load docker-image filsnap:latest
87+
```shell
88+
kind load docker-image filsnap:latest
8989
```
9090

9191
### Install Monitoring Stack
@@ -98,8 +98,8 @@ $ kind load docker-image filsnap:latest
9898
Install the prometheus monitoring stack with grafana enabled and persistence storage. This configuration enables cluster
9999
wide monitoring with no selectors, and persistence of data.
100100

101-
```
102-
$ cat > values-prom-stack.yaml <<EOF
101+
```yaml
102+
# values-prom-stack.yaml
103103
prometheus:
104104
prometheusSpec:
105105
ruleSelector: {}
@@ -128,25 +128,25 @@ grafana:
128128
size: 10Gi
129129
EOF
130130
```
131-
```
131+
```shell
132132
helm install prometheus prometheus-community/kube-prometheus-stack -n monitoring --values values-prom-stack.yaml
133133
```
134134

135135
### Installing MinIO Operator & Creating Tenant
136136

137137
[More Information: Operator](https://github.com/minio/operator)
138138

139-
```
140-
$ kubectl minio init
139+
```shell
140+
kubectl minio init
141141
```
142142

143143
#### Creating a Tenant
144144

145145
[More Information: Tenant](https://docs.min.io/minio/k8s/tenant-management/deploy-minio-tenant.html)
146146

147-
```
148-
$ kubectl create namespace minio
149-
$ kubectl minio proxy -n minio-operator
147+
```shell
148+
kubectl create namespace minio
149+
kubectl minio proxy -n minio-operator
150150
```
151151

152152
Follow the instruction provided by `minio proxy` and login to the operator console then click the `New Tenant`.
@@ -171,8 +171,8 @@ Copy down the Console Credentials, you will also use these for api access to the
171171

172172
#### Accessining MinIO Console & Creating Bucket
173173

174-
```
175-
$ kubectl port-forward service/minio-console 9090:9090 -n minio
174+
```shell
175+
kubectl port-forward service/minio-console 9090:9090 -n minio
176176
```
177177

178178
Open the console http://localhost:9090 and login using the Console Credentials.
@@ -183,8 +183,8 @@ Create a bucket called `filsnap` with all options disabled.
183183

184184
Create a namespace for the lotus daemons
185185

186-
```
187-
$ kubectl create namespace ntwk-butterflynet-filsnap
186+
```shell
187+
kubectl create namespace ntwk-butterflynet-filsnap
188188
```
189189

190190
Note: This is the same namespace you will develop in, not technically required, but it's easier
@@ -194,34 +194,34 @@ is required, otherwise all operations are `read-only` and wouldn't require a tok
194194

195195
#### Creating a shared jwt token
196196

197-
```
198-
$ mkdir /tmp/secrets
199-
$ lotus-shed jwt new node
200-
$ lotus-shed base16 -decode < jwt-node.jwts > /tmp/secrets/auth-jwt-private
201-
$ cp jwt-node.token /tmp/secrets/jwt-all-privs-token
202-
203-
$ lotus-shed jwt token --read --output /tmp/secrets/jwt-ro-privs-token jwt-node.jwts
204-
$ lotus-shed jwt token --read --write --output /tmp/secrets/jwt-rw-privs-token jwt-node.jwts
205-
$ lotus-shed jwt token --sign --output /tmp/secrets/jwt-so-privs-token jwt-node.jwts
206-
207-
$ kubectl create secret generic lotus-jwt \
208-
--from-file=auth-jwt-private=/tmp/secrets/auth-jwt-private \
209-
--from-file=jwt-all-privs-token=/tmp/secrets/jwt-all-privs-token \
210-
--from-file=jwt-ro-privs-token=/tmp/secrets/jwt-ro-privs-token \
211-
--from-file=jwt-rw-privs-token=/tmp/secrets/jwt-rw-privs-token \
212-
--from-file=jwt-so-privs-token=/tmp/secrets/jwt-so-privs-token \
213-
--output=name --namespace ntwk-butterflynet-filsnap
214-
215-
$ rm -rf /tmp/secrets
216-
$ rm jwt-node.jwts jwt-node.token
197+
```shell
198+
mkdir /tmp/secrets
199+
lotus-shed jwt new node
200+
lotus-shed base16 -decode < jwt-node.jwts > /tmp/secrets/auth-jwt-private
201+
cp jwt-node.token /tmp/secrets/jwt-all-privs-token
202+
203+
lotus-shed jwt token --read --output /tmp/secrets/jwt-ro-privs-token jwt-node.jwts
204+
lotus-shed jwt token --read --write --output /tmp/secrets/jwt-rw-privs-token jwt-node.jwts
205+
lotus-shed jwt token --sign --output /tmp/secrets/jwt-so-privs-token jwt-node.jwts
206+
207+
kubectl create secret generic lotus-jwt \
208+
--from-file=auth-jwt-private=/tmp/secrets/auth-jwt-private \
209+
--from-file=jwt-all-privs-token=/tmp/secrets/jwt-all-privs-token \
210+
--from-file=jwt-ro-privs-token=/tmp/secrets/jwt-ro-privs-token \
211+
--from-file=jwt-rw-privs-token=/tmp/secrets/jwt-rw-privs-token \
212+
--from-file=jwt-so-privs-token=/tmp/secrets/jwt-so-privs-token \
213+
--output=name --namespace ntwk-butterflynet-filsnap
214+
215+
rm -rf /tmp/secrets
216+
rm jwt-node.jwts jwt-node.token
217217
```
218218

219219
#### Install Butterfly Lotus Daemons
220220

221221
[Docker Images](https://hub.docker.com/r/travisperson/lotus/tags?page=1&name=butterfly)
222222

223-
```
224-
$ cat values-lotus.yaml <<EOF
223+
```yaml
224+
# values-lotus.yaml
225225
image:
226226
tag: butterflynet-<version>
227227

@@ -260,7 +260,7 @@ persistence:
260260
size: "1Gi"
261261
EOF
262262
```
263-
```
263+
```shell
264264
helm install lotus-a filecoin/lotus-fullnode --values values-lotus.yaml --namespace ntwk-butterflynet-filsnap
265265
helm install lotus-b filecoin/lotus-fullnode --values values-lotus.yaml --namespace ntwk-butterflynet-filsnap
266266
helm install lotus-c filecoin/lotus-fullnode --values values-lotus.yaml --namespace ntwk-butterflynet-filsnap

0 commit comments

Comments
 (0)