|
1 | 1 | # Single Node Kubernetes Deployment |
2 | 2 |
|
3 | | -This document provides instructions for deploying a single-node Kubernetes cluster using the Block Node Server Helm chart. |
4 | | -This setup is ideal for production environments on bare m=metal or cloud VMs. |
| 3 | +This document provides instructions for deploying the Block Node Server Helm chart in a Single-Node Kubernetes environment. |
| 4 | +This setup is ideal for production environments on bare metal or cloud VMs. |
5 | 5 |
|
6 | 6 | ## Prerequisites |
7 | | - The single requirement is a server with a supported operating system and sufficient resources to run Kubernetes and the Block Node Server. |
| 7 | + |
| 8 | +The single requirement is a server with a supported operating system and sufficient resources to run Kubernetes and the |
| 9 | +Block Node Server. |
8 | 10 |
|
9 | 11 | Suggested minimum specifications: |
10 | 12 |
|
11 | | -1. Local Full History (LFH) |
12 | | - - CPU: 24 cores, 48 threads (2024 or newer CPU) (PCIe 4+) |
13 | | - - RAM: 256 GB |
14 | | - - Disk: |
15 | | - - 8 TB NVMe SSD |
16 | | - - 500 TB |
17 | | - - 2 x 10 Gbps Network Interface Cards (NICs) |
18 | | -2. Remote Full History (RFH) |
19 | | - - CPU: 24 cores, 48 threads (2024 or newer CPU) (PCIe 4+) |
20 | | - - RAM: 256 GB |
21 | | - - Disk: 8 TB NVMe SSD |
22 | | - - 2 x 10 Gbps Network Interface Cards (NICs) |
23 | | - |
24 | | -In both configurations a Linux-based operating system is recommended, such as Ubuntu 22.04 LTS. |
| 13 | +1. **Local Full History (LFH)**: All block history is stored locally on the server. |
| 14 | + - CPU: 24 cores, 48 threads (2024 or newer CPU) (PCIe 4+) |
| 15 | + - RAM: 256 GB |
| 16 | + - Disk: |
| 17 | + - 8 TB NVMe SSD |
| 18 | + - 500 TB |
| 19 | + - 2 x 10 Gbps Network Interface Cards (NICs) |
| 20 | +2. **Remote Full History (RFH)**: Block history is stored remotely. |
| 21 | + - CPU: 24 cores, 48 threads (2024 or newer CPU) (PCIe 4+) |
| 22 | + - RAM: 256 GB |
| 23 | + - Disk: 8 TB NVMe SSD |
| 24 | + - 2 x 10 Gbps Network Interface Cards (NICs) |
| 25 | + |
| 26 | +Recommendations: |
| 27 | +- In both configurations a Linux-based operating system is recommended, such as Ubuntu 22.04 LTS or Debian 11 LTS. |
| 28 | +- Whiles 10 Gbps NICs are suggested, we recommend higher bandwidth NICs (20 Gbps or more) for better performance and future-proofing. |
25 | 29 |
|
26 | 30 | Note: Servers may be acquired by bare metal providers or cloud service providers that offer dedicated instances. |
27 | 31 | LFH servers require significant storage capacity, as such these are expected to be sourced from bare metal providers. |
28 | 32 |
|
29 | 33 | ## Server Provisioning |
30 | 34 |
|
31 | | -Once a server has been acquired, it needs to be provisioned with the necessary software components to run Kubernetes and the Block Node Server. |
32 | | - |
33 | | -Assuming an ubuntu environment, [./scripts/ubuntu-production.sh](./scripts/ubuntu-production.sh) serves as a provisioner script to automate the installation of required dependencies.: |
| 35 | +Once a server has been acquired, it needs to be provisioned with the necessary software components to run Kubernetes |
| 36 | +and the Block Node Server. |
34 | 37 |
|
| 38 | +Assuming a Linux based environment, [./scripts/linux-bare-metal-provisioner.sh](scripts/linux-bare-metal-provisioner.sh) serves as a provisioner script to automate the |
| 39 | +installation of required dependencies.: |
35 | 40 |
|
36 | 41 | ## Installation Steps |
37 | 42 |
|
38 | 43 | With the server provisioned, follow these steps to deploy the Block Node Server on a single-node Kubernetes cluster: |
39 | 44 |
|
40 | 45 | Note: Some steps are marked as intermediate, indicating they will change due to improvements |
41 | 46 |
|
42 | | -1. **ENV variables**: Set some helpful environment variables for your deployment in a `.env file: |
| 47 | +1. **ENV variables setup**: Set some helpful environment variables for your deployment in a `.env file: |
43 | 48 |
|
44 | 49 | ```bash |
45 | | - NAMESPACE=<insert namepace> |
46 | | - RELEASE=<insert release name> |
47 | | - VERSION=<insert latest stable block node GA version> |
48 | | - POD=${RELEASE}-block-node-server-0 |
| 50 | + NAMESPACE=<insert namepace> |
| 51 | + RELEASE=<insert release name> |
| 52 | + VERSION=<insert latest stable block node GA version> |
| 53 | + POD=${RELEASE}-block-node-server-0 |
49 | 54 | ``` |
50 | 55 |
|
51 | | -2. (Intermediate) **Automate with Task**: Use the provided [./scripts/Taskfile.yml](./scripts/Taskfile.yml) to streamline the deployment process. |
52 | | - The Taskfile includes tasks for installing Helm charts, configuring the Block Node Server, and managing the Kubernetes cluster. |
| 56 | + A sample `.env` file is provided at [./scripts/.env.sample](./scripts/.env.sample). |
53 | 57 |
|
| 58 | +2. (Intermediate) **Automate with Task**: Use the provided [./scripts/Taskfile.yml](./scripts/Taskfile.yml) to |
| 59 | + streamline the deployment process. The Taskfile includes tasks for installing Helm charts, configuring the Block Node |
| 60 | + Server, and managing the Kubernetes cluster. |
54 | 61 |
|
55 | 62 | 3. (Intermediate) **Setup `kubectl` and `helm` environments**: |
56 | 63 |
|
57 | | - ```bash |
58 | | - task load-kubectl-helm |
59 | | - ``` |
| 64 | + ```bash |
| 65 | + task load-kubectl-helm |
| 66 | + ``` |
| 67 | +4. **Configure Persistent Volume Creation Script**: Create Persistent Volume (PV)s and Persistent Volume Claim (PVC)s |
| 68 | + for Block Node Server data storage. |
60 | 69 |
|
61 | | -4. **Configure Persistent Volume Creation Script**: Create Persistent Volume (PV)s and Persistent Volume Claim (PVC)s for Block Node Server data storage. |
| 70 | + Update [./values-overrides/host-paths.yaml](./values-overrides/host-paths.yaml) with the appropriate namespace. |
62 | 71 |
|
63 | | - Update [./values-overrides/host-paths.yaml](./values-overrides/host-paths.yaml) with the appropriate namespace. |
64 | 72 | ```bash |
65 | 73 | kubectl apply -f ./k8s/single-node/pv-pvc.yaml -n ${NAMESPACE} |
66 | 74 | ``` |
67 | | - |
68 | 75 | 5. **Configure Helm Chart Values**: Customize the Helm chart values for your deployment. |
69 | 76 |
|
70 | 77 | Update [./values-overrides/lfh-values.yaml](./values-overrides/lfh.yaml) or [./values-overrides/rfh-values.yaml](./values-overrides/rfh.yaml) with your specific configuration settings. |
71 | 78 |
|
72 | 79 | 6. **Install Block Node Server Helm Chart**: Deploy the Block Node Server using Helm. |
| 80 | + |
73 | 81 | ```bash |
74 | 82 | task helm-release |
75 | | - ``` |
76 | | - |
| 83 | + ``` |
77 | 84 | 7. **Verify Deployment**: Check the status of the Block Node Server deployment to ensure it is running correctly. |
| 85 | + |
78 | 86 | ```bash |
79 | 87 | kubectl get pods -n ${NAMESPACE} |
80 | 88 | kubectl logs ${POD} -n ${NAMESPACE} |
81 | 89 | ``` |
82 | 90 |
|
83 | | - Expected output should indicate that the Block Node Server is operational. |
| 91 | + Expected output should indicate that the Block Node Server is operational. |
| 92 | + |
84 | 93 | ```bash |
85 | 94 | # [org.hiero.block.node.app.BlockNodeApp start] Started BlockNode Server : State = RUNNING, Historic blocks = |
86 | 95 | ``` |
87 | | - |
88 | 96 | 8. **Access Block Node Server**: Connect to the Block Node Server using the configured service endpoint. |
89 | 97 |
|
90 | | - Install `grpcurl` if not already installed: |
| 98 | + Install `grpcurl` if not already installed: |
| 99 | + |
91 | 100 | ```bash |
92 | 101 | curl -L https://github.com/fullstorydev/grpcurl/releases/download/v1.8.7/grpcurl_1.8.7_linux_x86_64.tar.gz -o grpcurl.tar.gz |
93 | 102 | sudo tar -xzf grpcurl.tar.gz -C /usr/local/bin grpcurl |
94 | 103 | rm grpcurl.tar.gz |
95 | 104 | ``` |
96 | 105 |
|
97 | | - Install protobuf compiler if not already installed: |
98 | | - ```bash |
99 | | - VERSION="latest stable version here" |
100 | | - BASE_URL="https://github.com/hiero-ledger/hiero-block-node/releases/download/v${VERSION}" |
101 | | - ARCHIVE="block-node-protobuf-${VERSION}.tgz" |
102 | | - TGZ="block-node-protobuf-${VERSION}.tgz" |
103 | | - DEST_DIR="${HOME}/block-node-protobuf-${VERSION}" |
104 | | -
|
105 | | - curl -L "${BASE_URL}/${ARCHIVE}" -o "${ARCHIVE}" |
106 | | -
|
107 | | - # Ensure unzip is available |
108 | | - command -v unzip >/dev/null 2>&1 || sudo apt-get install -y unzip |
109 | | -
|
110 | | - mkdir -p "${DEST_DIR}" |
111 | | - tar -xzf "${ARCHIVE}" -C "${DEST_DIR}" |
112 | | - # This is needed as tar doesnt support to overwrite the existing tar |
113 | | - tar -xzf "${DEST_DIR}"/block-node-protobuf-${VERSION}.tgz -C "${DEST_DIR}" |
114 | | - rm "${ARCHIVE}" "${DEST_DIR}/${TGZ}" |
115 | | - ``` |
| 106 | + Install protobuf compiler if not already installed: |
116 | 107 |
|
117 | | - Use `grpcurl` to interact with the Block Node Server: |
118 | | - ```bash |
119 | | - grpcurl -plaintext -emit-defaults -import-path block-node-protobuf-<VERSION> -proto block-node/api/node_service.proto -d '{}' <host>:40840 org.hiero.block.api.BlockNodeService/serverStatus |
120 | | - ``` |
| 108 | + ```bash |
| 109 | + VERSION="latest stable version here" |
| 110 | + BASE_URL="https://github.com/hiero-ledger/hiero-block-node/releases/download/v${VERSION}" |
| 111 | + ARCHIVE="block-node-protobuf-${VERSION}.tgz" |
| 112 | + TGZ="block-node-protobuf-${VERSION}.tgz" |
| 113 | + DEST_DIR="${HOME}/block-node-protobuf-${VERSION}" |
| 114 | + |
| 115 | + curl -L "${BASE_URL}/${ARCHIVE}" -o "${ARCHIVE}" |
| 116 | + |
| 117 | + # Ensure unzip is available |
| 118 | + command -v unzip >/dev/null 2>&1 || sudo apt-get install -y unzip |
| 119 | + |
| 120 | + mkdir -p "${DEST_DIR}" |
| 121 | + tar -xzf "${ARCHIVE}" -C "${DEST_DIR}" |
| 122 | + # This is needed as tar doesnt support to overwrite the existing tar |
| 123 | + tar -xzf "${DEST_DIR}"/block-node-protobuf-${VERSION}.tgz -C "${DEST_DIR}" |
| 124 | + rm "${ARCHIVE}" "${DEST_DIR}/${TGZ}" |
| 125 | + ``` |
121 | 126 |
|
122 | | - Expected output should show the server status: |
123 | | - ```bash |
124 | | - # expected response will be, 18446744073709551615 implies -1 which is expected on a new BN |
125 | | - { |
126 | | - "firstAvailableBlock": "18446744073709551615", |
127 | | - "lastAvailableBlock": "18446744073709551615", |
128 | | - "onlyLatestState": false, |
129 | | - "versionInformation": null |
130 | | - } |
131 | | - ``` |
| 127 | + Use `grpcurl` to interact with the Block Node Server: |
| 128 | + |
| 129 | + ```bash |
| 130 | + grpcurl -plaintext -emit-defaults -import-path block-node-protobuf-<VERSION> -proto block-node/api/node_service.proto -d '{}' <host>:40840 org.hiero.block.api.BlockNodeService/serverStatus |
| 131 | + ``` |
| 132 | + |
| 133 | + Expected output should show the server status: |
| 134 | + |
| 135 | + ```bash |
| 136 | + # expected response will be, 18446744073709551615 implies -1 which is expected on a new BN |
| 137 | + { |
| 138 | + "firstAvailableBlock": "18446744073709551615", |
| 139 | + "lastAvailableBlock": "18446744073709551615", |
| 140 | + "onlyLatestState": false, |
| 141 | + "versionInformation": null |
| 142 | + } |
| 143 | + ``` |
| 144 | +9. **Helm Chart Upgrades**: To upgrade the Block Node Server Helm chart to a newer version, update the `VERSION` |
| 145 | + variable in your `.env` file and run: |
132 | 146 |
|
133 | | -9. **Helm Chart Upgrades**: To upgrade the Block Node Server Helm chart to a newer version, update the `VERSION` variable in your `.env` file and run: |
134 | 147 | ```bash |
135 | 148 | task helm-upgrade |
136 | 149 | ``` |
| 150 | +10. **(Caution) Reset Block Node Server Data**: To reset the Block Node Server (clear data and install version), run: |
| 151 | + |
| 152 | + ```bash |
| 153 | + task reset-upgrade |
| 154 | + ``` |
| 155 | +11. **Uninstall Block Node Server**: To uninstall the Block Node Server and remove all associated resources, run: |
| 156 | + |
| 157 | +```bash |
| 158 | +task clear-release |
| 159 | +``` |
0 commit comments