Skip to content

Commit e2ab9ab

Browse files
edit kubernetes tutorials (#932)
* edit kubernetes tutorials Signed-off-by: Alexandra Tran <[email protected]> * apply reviewer feedback Signed-off-by: Alexandra Tran <[email protected]>
1 parent 05ab40c commit e2ab9ab

File tree

5 files changed

+120
-110
lines changed

5 files changed

+120
-110
lines changed

docs/Tutorials/Kubernetes/Create-Cluster.md

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ description: Create a cluster for deployment
55

66
# Create a cluster
77

8-
Create a cluster before you deploy the network, there are options locally and in cloud.
8+
You can create a [local](#local-clusters) or [cloud](#cloud-clusters) cluster to deploy a Besu network using
9+
Kubernetes.
910

1011
## Prerequisites
1112

@@ -18,8 +19,7 @@ Create a cluster before you deploy the network, there are options locally and in
1819

1920
## Local Clusters
2021

21-
Use one of several options to create a local cluster. Select one listed below, or another that you
22-
are comfortable with.
22+
Use one of several options to create a local cluster. Select one listed below, or another that you're comfortable with.
2323

2424
### Minikube
2525

@@ -49,52 +49,52 @@ kind create cluster
4949

5050
### Rancher
5151

52-
[Rancher](https://github.com/rancher-sandbox/rancher-desktop/) is a light-weight open source desktop application
53-
for Mac, Windows and Linux. It provides Kubernetes and container management, and allows you to choose the
52+
[Rancher](https://github.com/rancher-sandbox/rancher-desktop/) is a lightweight open source desktop application
53+
for Mac, Windows, and Linux. It provides Kubernetes and container management, and allows you to choose the
5454
version of Kubernetes to run.
5555

56-
It can build, push, pull and run container images. Built container images can be run without needing a registry.
56+
It can build, push, pull, and run container images. Built container images can be run without needing a registry.
5757

5858
!!!note
5959
The official Docker-CLI is not supported but rather uses [nerdctl](https://github.com/containerd/nerdctl) which is
6060
a Docker-CLI compatible tool for containerd, and is automatically installed with Rancher Desktop.
6161

6262
!!!note
63-
For Windows, you need to [install Windows Subsystem for Linux (WSL)](https://docs.microsoft.com/en-us/windows/wsl/install)
63+
For Windows, you must [install Windows Subsystem for Linux (WSL)](https://docs.microsoft.com/en-us/windows/wsl/install)
6464
to install Rancher Desktop.
6565

6666
Refer to the [official documentation](https://github.com/rancher-sandbox/docs.rancherdesktop.io/blob/main/docs/installation.md)
6767
for system requirements and installation instructions.
6868

69-
## Cloud Clusters
69+
## Cloud clusters
7070

7171
### AWS EKS
7272

7373
[AWS Elastic Kubernetes Service (AWS EKS)](https://aws.amazon.com/eks/) is one of the most popular platforms
7474
to deploy Hyperledger Besu.
7575

76-
To create a cluster in AWS, you need to install the [AWS CLI](https://aws.amazon.com/cli/) and
76+
To create a cluster in AWS, you must install the [AWS CLI](https://aws.amazon.com/cli/) and
7777
[`eksctl`](https://eksctl.io/).
7878

7979
The [template](https://github.com/ConsenSys/quorum-kubernetes/tree/master/aws) comprises the base
8080
infrastructure used to build the cluster and other resources in AWS. We also use AWS native
8181
services and features after the cluster is created. These include:
8282

83-
* [Pod identities](https://github.com/aws/amazon-eks-pod-identity-webhook)
84-
* [Secrets Store CSI drivers](https://docs.aws.amazon.com/eks/latest/userguide/ebs-csi.html)
83+
* [Pod identities](https://github.com/aws/amazon-eks-pod-identity-webhook).
84+
* [Secrets Store CSI drivers](https://docs.aws.amazon.com/eks/latest/userguide/ebs-csi.html).
8585
* Dynamic storage classes backed by AWS EBS. The
8686
[volume claims](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#persistentvolumeclaims) are fixed
87-
sizes and can be updated as you grow via helm updates, and will not need to re-provision the underlying storage
87+
sizes and can be updated as you grow via helm updates, and won't need to re-provision the underlying storage
8888
class.
8989
* [CNI](https://docs.aws.amazon.com/eks/latest/userguide/pod-networking.html) networking mode for EKS. By default,
9090
EKS clusters use `kubenet` to create a virtual network and subnet. Nodes get an IP
9191
address from a virtual network subnet. Network address translation (NAT) is then configured on the nodes, and pods
9292
receive an IP address "hidden" behind the node IP.
9393

9494
!!! note
95-
This approach reduces the number of IP addresses that you need
96-
to reserve in your network space for pods, but places constraints on what can connect to the nodes from
97-
outside the cluster (for example on premises nodes or those on another cloud provider).
95+
This approach reduces the number of IP addresses that you must reserve in your network space for pods, but
96+
constrains what can connect to the nodes from
97+
outside the cluster (for example, on-premise nodes or those on another cloud provider).
9898

9999
AWS Container Networking Interface (CNI) provides each pod with an IP address from the subnet, and can be accessed
100100
directly. The IP addresses must be unique across your network space, and must be planned in advance. Each node has
@@ -119,7 +119,7 @@ your VPC details.
119119
```
120120

121121
1. Optionally, deploy the
122-
[kubernetes dashboard](https://github.com/ConsenSys/quorum-kubernetes/tree/master/aws/templates/k8s-dashboard)
122+
[kubernetes dashboard](https://github.com/ConsenSys/quorum-kubernetes/tree/master/aws/templates/k8s-dashboard).
123123

124124
1. Provision the drivers. After the deployment completes, provision the secrets manager, identity, and
125125
CSI drivers. Use `besu` for `EKS_NAMESPACE` and update `AWS_REGION` and `EKS_CLUSTER_NAME` in the
@@ -144,30 +144,31 @@ commands below to match your settings from step 2.
144144

145145
1. You can now use your cluster and you can deploy [Helm charts](./Deploy-Charts.md) to it.
146146

147-
### [Azure AKS](https://azure.microsoft.com/en-au/services/kubernetes-service/)
147+
### Azure Kubernetes Service
148148

149-
Azure Kubernetes Service is also a popular cloud platform that you can use to deploy Besu. To create a cluster in
150-
Azure, you need to install the [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli) and you
151-
must have admin rights on your Azure subscription to enable some preview features on AKS.
149+
[Azure Kubernetes Service (AKS)](https://azure.microsoft.com/en-us/services/kubernetes-service/) is another popular cloud
150+
platform that you can use to deploy Besu. To create a cluster in
151+
Azure, you must install the [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli) and have admin
152+
rights on your Azure subscription to enable some preview features on AKS.
152153

153154
The [template](https://github.com/ConsenSys/quorum-kubernetes/tree/master/azure) comprises the base
154155
infrastructure used to build the cluster and other resources in Azure. We also make use Azure native
155156
services and features after the cluster is created. These include:
156157

157158
* [AAD pod identities](https://docs.microsoft.com/en-us/azure/aks/use-azure-ad-pod-identity).
158-
* [Secrets Store CSI drivers](https://docs.microsoft.com/en-us/azure/key-vault/general/key-vault-integrate-kubernetes)
159+
* [Secrets Store CSI drivers](https://docs.microsoft.com/en-us/azure/key-vault/general/key-vault-integrate-kubernetes).
159160
* Dynamic storage classes backed by Azure Files. The
160161
[volume claims](https://docs.microsoft.com/en-us/azure/aks/azure-disks-dynamic-pv) are fixed sizes and can be updated
161-
as you grow via helm updates, and will not need to re-provision the underlying storage class.
162+
as you grow via helm updates, and won't need to re-provision the underlying storage class.
162163
* [CNI](https://docs.microsoft.com/en-us/azure/aks/configure-azure-cni) networking mode for AKS. By default, AKS
163164
clusters use `kubenet`, to create a virtual network and subnet. Nodes get an IP address
164165
from a virtual network subnet. Network address translation (NAT) is then configured on the nodes, and pods receive
165166
an IP address "hidden" behind the node IP.
166167
167168
!!! note
168-
This approach reduces the number of IP addresses that you need to reserve
169-
in your network space for pods to use, however places constraints on what can connect to the nodes from outside the
170-
cluster (for example on prem nodes or other cloud providers)
169+
This approach reduces the number of IP addresses you must reserve
170+
in your network space for pods to use, but constrains what can connect to the nodes from outside the
171+
cluster (for example, on-premise nodes or other cloud providers).
171172
172173
AKS Container Networking Interface (CNI) provides each pod with an IP address from the subnet, and can be accessed
173174
directly. These IP addresses must be unique across your network space, and must be planned in advance. Each node has
@@ -177,15 +178,15 @@ exhaustion as your application demands grow, however makes it easier for externa
177178
178179
!!!warning
179180
180-
Please do not create more than one AKS cluster in the same subnet. AKS clusters may not use 169.254.0.0/16,
181-
172.30.0.0/16, 172.31.0.0/16, or 192.0.2.0/24 for the Kubernetes service address range.
181+
Please do not create more than one AKS cluster in the same subnet. AKS clusters may not use `169.254.0.0/16`,
182+
`172.30.0.0/16`, `172.31.0.0/16`, or `192.0.2.0/24` for the Kubernetes service address range.
182183
183184
To provision the cluster:
184185
185186
1. Enable the preview features that allow you to use AKS with CNI, and a managed identity to authenticate and
186187
run cluster operations with other services. We also enable
187188
[AAD pod identities](https://docs.microsoft.com/en-us/azure/aks/use-azure-ad-pod-identity) which use the managed
188-
identity. This is in preview so you need to enable this feature by registering the `EnablePodIdentityPreview` feature:
189+
identity. This is in preview, so you must enable this feature by registering the `EnablePodIdentityPreview` feature:
189190
190191
```bash
191192
az feature register --name EnablePodIdentityPreview --namespace Microsoft.ContainerService

docs/Tutorials/Kubernetes/Deploy-Charts.md

Lines changed: 38 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ to the `dev` directory for the rest of this tutorial.
2121
cd dev/helm
2222
```
2323

24-
If you are running the cluster on AWS or Azure, update the `values.yml` with `provider: aws` or
24+
If you're running the cluster on AWS or Azure, update the `values.yml` with `provider: aws` or
2525
`provider: azure` as well.
2626

2727
!!! note
@@ -51,7 +51,7 @@ This tutorial isolates groups of resources (for example, StatefulSets and Servic
5151
!!! note
5252

5353
The rest of this tutorial uses `besu` as the namespace,
54-
but you are free to pick any name when deploying, but it must be consistent across the
54+
but you're free to pick any name when deploying, as long as it's consistent across the
5555
[infrastructure scripts](./Create-Cluster.md) and charts.
5656

5757
Run the following in a terminal window:
@@ -124,17 +124,17 @@ deploy the chart using:
124124
helm install genesis ./charts/besu-genesis --namespace besu --create-namespace --values ./values/genesis-besu.yml
125125
```
126126

127-
Once completed, view the genesis and enodes (the list of static nodes) config maps that every Besu node uses. and
128-
validator and bootnodes node keys saves as secrets.
127+
Once completed, view the genesis and enodes (the list of static nodes) configuration maps that every Besu node uses, and
128+
the validator and bootnode node keys as secrets.
129129

130130
![k8s-genesis-configmaps](../../images/kubernetes-genesis-configmaps.png)
131131

132132
![k8s-genesis-secrets](../../images/kuberenetes-genesis-secrets.png)
133133

134134
### 5. Deploy the bootnodes
135135

136-
The Dev charts uses two bootnodes to replicate best practices for a production network. Each Besu node has flags
137-
that tell the StatefulSet what to deploy and how to cleanup.
136+
The Dev charts use two bootnodes to replicate best practices for a production network. Each Besu node has flags
137+
that tell the StatefulSet what to deploy and how to clean up.
138138
The default `values.yml` for the StatefulSet define the following flags which are present in all the
139139
override values files.
140140

@@ -146,12 +146,12 @@ nodeFlags:
146146
removeKeysOnDeletion: false
147147
```
148148

149-
We do not generate keys for the bootnodes and initial validator pool. To create a Tessera pod paired to Besu
149+
We don't generate keys for the bootnodes and initial validator pool. To create a Tessera pod paired to Besu
150150
for private transactions, set the `privacy` flag to `true`. Optionally remove the secrets for the node if you
151151
delete the StatefulSet (for example removing a member node) by setting the `removeKeysOnDeletion` flag to `true`.
152152

153-
For the bootnodes set `bootnode: true` flag to indicate they are bootnodes. All the other nodes
154-
(for example, validators and members) wait for the bootnodes to be up before proceeding, and have this flag set to `false`.
153+
For the bootnodes, set the `bootnode` flag to `true` to indicate they are bootnodes. All the other nodes
154+
(for example, validators, and members) wait for the bootnodes to be up before proceeding, and have this flag set to `false`.
155155

156156
```bash
157157
helm install bootnode-1 ./charts/besu-node --namespace besu --values ./values/bootnode.yml
@@ -160,11 +160,11 @@ helm install bootnode-2 ./charts/besu-node --namespace besu --values ./values/bo
160160

161161
!!! warning
162162

163-
It is important to keep the release names of the bootnodes the same as it is tied to the keys that the genesis chart
164-
creates. So we use `bootnode-1` and `bootnode-2` in the command above.
163+
It's important to keep the release names of the bootnodes the same as it is tied to the keys that the genesis chart
164+
creates. So we use `bootnode-1` and `bootnode-2` in the previous command.
165165

166-
Once complete, you will see two StatefulSets, and the two bootnodes will discover themselves and peer. However because
167-
there are no validators present yet, there will be no blocks created as can be seen in the logs below.
166+
Once complete, you see two StatefulSets, and the two bootnodes discover themselves and peer.
167+
Because there are no validators present yet, there are no blocks created, as seen in the following logs.
168168

169169
![k8s-bootnode-logs](../../images/kubernetes-bootnode-logs.png)
170170

@@ -184,11 +184,11 @@ helm install validator-4 ./charts/besu-node --namespace besu --values ./values/v
184184

185185
!!! warning
186186

187-
As with the bootnodes, it is important to keep the release names of the initial validators the same as it is tied
188-
to the keys that the genesis chart creates. So we use `validator-1`, `validator-2` and so on in the command above.
187+
As with the bootnodes, it's important to keep the release names of the initial validators the same as it is tied
188+
to the keys that the genesis chart creates. So we use `validator-1`, `validator-2`, etc. in the previous command.
189189

190-
Once completed, you may need to give the validators a few minutes to peer and for round changes, depending when the first
191-
validator was spun up, before the logs display blocks being created.
190+
Once completed, you may need to give the validators a few minutes to peer and for round changes, depending on when the
191+
first validator was spun up, before the logs display blocks being created.
192192

193193
![k8s-validator-logs](../../images/kubernetes-validator-logs.png)
194194

@@ -197,9 +197,9 @@ To add a validator into the network, deploy a normal RPC node (step 7) and then
197197

198198
### 7. Deploy RPC or transaction nodes
199199

200-
These nodes need their own node keys, so we set the `generateKeys: true` for a standard RPC node. For a Transaction node
201-
(Besu paired with Tessera for private transactions) we also set the `privacy: true` flag and deploy in the same manner
202-
as before.
200+
These nodes need their own node keys, so set the `generateKeys` flag to `true` for a standard RPC node.
201+
For a transaction node (Besu paired with Tessera for private transactions), set the `privacy` flag to `true` and
202+
deploy in the same manner as before.
203203

204204
For an RPC node with the release name `rpc-1`:
205205

@@ -213,11 +213,11 @@ For a transaction node release name `tx-1`:
213213
helm install tx-1 ./charts/besu-node --namespace besu --values ./values/txnode.yml
214214
```
215215

216-
Logs for `tx-1` would resemble the following for Tessera:
216+
Logs for `tx-1` resemble the following for Tessera:
217217

218218
![`k8s-tx-tessera-logs`](../../images/kubernetes-tx-tessera-logs.png)
219219

220-
Logs for Besu resembles the following:
220+
Logs for Besu resemble the following:
221221

222222
![`k8s-tx-Besu-logs`](../../images/kubernetes-tx-Besu-logs.png)
223223

@@ -250,30 +250,32 @@ that match your deployments, deploy the rules as follows:
250250
kubectl apply -f ../../ingress/ingress-rules-besu.yml
251251
```
252252

253-
Once complete, view the IP address under the `Ingress` section if you are using the Kubernetes Dashboard
253+
Once complete, view the IP address under the `Ingress` section if you're using the Kubernetes Dashboard
254254
or equivalent `kubectl` command.
255255

256256
![`k8s-ingress`](../../images/kubernetes-ingress-ip.png)
257257

258-
The Grafana dashboard can be viewed by going to:
258+
You can view the Grafana dashboard by going to:
259259

260260
```bash
261261
# For Besu's grafana address:
262262
http://<INGRESS_IP>/d/XE4V0WGZz/besu-overview?orgId=1&refresh=10s
263263
```
264264

265-
Or for RPC calls:
265+
The following is an example RPC call, which confirms that the node running the JSON-RPC service is syncing:
266266

267-
```bash
268-
curl -v -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' http://<INGRESS_IP>/rpc
269-
```
267+
=== "curl HTTP request"
270268

271-
The call returns the following to confirm that the node running the JSON-RPC service is syncing:
269+
```bash
270+
curl -v -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' http://<INGRESS_IP>/rpc
271+
```
272272

273-
```json
274-
{
275-
"jsonrpc" : "2.0",
276-
"id" : 1,
277-
"result" : "0x4e9"
278-
}
279-
```
273+
=== "JSON result"
274+
275+
```json
276+
{
277+
"jsonrpc" : "2.0",
278+
"id" : 1,
279+
"result" : "0x4e9"
280+
}
281+
```

docs/Tutorials/Kubernetes/Maintenance.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ description: Maintenance for Besu on a Kubernetes cluster
1010
* Install [Kubectl](https://kubernetes.io/docs/tasks/tools/)
1111
* Install [Helm3](https://helm.sh/docs/intro/install/)
1212

13-
## Update a persistent volume claim (PVC) size
13+
## Update a persistent volume claim size
1414

15-
As the chain grows so does the amount of space used by the PVC. As of Kubernetes v1.11,
16-
[certain types of Storage Classes](https://kubernetes.io/docs/concepts/storage/storage-classes/#allow-volume-expansion)
17-
allow volume resizing. Our production charts for Azure use Azure Files and for AWS use EBS Block Store which allow for
18-
volume expansion.
15+
Over time, as the chain grows so will the amount of space used by the persistent volume claim (PVC).
16+
As of Kubernetes v1.11, [certain types of Storage Classes](https://kubernetes.io/docs/concepts/storage/storage-classes/#allow-volume-expansion)
17+
allow volume resizing.
18+
Production charts for Azure use Azure Files and on AWS use EBS Block Store which allow for volume expansion.
1919

20-
To update the volume size, add the following to the override values file. For example to increase the size on the
21-
transaction nodes volumes, add the following snippet to the
20+
To update the volume size, you must update the override values file.
21+
For example, to increase the size on the transaction nodes volumes, add the following snippet to the
2222
[`txnode values.yml`](https://github.com/ConsenSys/quorum-kubernetes/blob/master/dev/helm/values/txnode.yml) file, with
23-
appropriate size (for example 50Gi below).
23+
the new size limit (the following example uses 50Gi).
2424

2525
```bash
2626
storage:
@@ -40,10 +40,10 @@ helm upgrade tx-1 ./charts/besu-node --namespace besu --values ./values/txnode.y
4040

4141
When updating Besu nodes across a cluster, perform the updatesas a rolling update and not all at once,
4242
especially for the validator pool. If all the validators are taken offline, the
43-
chain will halt, and you'll have to wait for round changes to expire before blocks are created again.
43+
chain halts, and you must wait for round changes to expire before blocks are created again.
4444

4545
Updates for Besu can be done via Helm in exactly the same manner as other applications. Alternatively, this can be done
46-
via `kubectl`. In this example, we'll update a node called `besu-validator-3`:
46+
via `kubectl`. This example updates a node called `besu-validator-3`:
4747

4848
1. Set the update policy to use rolling updates (if not done already):
4949

0 commit comments

Comments
 (0)