Kubernetes manifests for running cryptocurrency nodes.
Here is quick HOWTO deploy nodes into GKE env.
- linux/macos terminal
- git
- gcloud
- kubectl (version from gcloud is ok)
- helm
- follow "Before you begin" part of GCP manual
- Create k8s GKE two zone cluster, use at least n1-highmem4 instances
- Install Helm
- Allocate 2 regional IP adresses, use the same region as your GKE cluster
export PROJECT_ID=$(gcloud config get-value project)
export REGION=us-central1
gcloud compute addresses create dev-btc-0 --region $REGION --project=$PROJECT_ID
gcloud compute addresses create dev-eth-0 --region $REGION --project=$PROJECT_ID
gcloud compute addresses create dev-btc-1 --region $REGION --project=$PROJECT_ID
gcloud compute addresses create dev-eth-1 --region $REGION --project=$PROJECT_ID
gcloud compute addresses list --project=$PROJECT_ID
- Adjust zones in regional storage classes
sc-ssd-regional.yaml
andsc-standard-regional.yaml
, use the same zones as you used with GKE cluster. - Create storage classes, replace K8S_CONTEXT with real value.
export K8S_CONTEXT=baas0
kubectl --context $K8S_CONTEXT create -f sc-ssd.yaml
kubectl --context $K8S_CONTEXT create -f sc-ssd-regional.yaml
kubectl --context $K8S_CONTEXT create -f sc-standard-regional.yaml
- Copy
example-values-parity.yaml
andexample-values-bitcoind.yaml
tovalues-parity.yaml
andvalues-bitcoind.yaml
cp example-values-parity.yaml values-parity.yaml
cp example-values-bitcoind.yaml values-bitcoind.yaml
- Adjust
values-parity.yaml
andvalues-bitcoind.yaml
, pay attention to resource requests and limits, IP adresses, volume size, and RPC credentials. Replace198.51.100.0
and203.0.113.0
with real IP values of allocated adresses.
export EDITOR=vi
$EDITOR values-bitcoind.yaml
$EDITOR values-parity.yaml
- Deploy cryptonodes
helm --kube-context $K8S_CONTEXT install charts/parity/ --namespace dev-eth-0 --name dev-eth-0 --values values-parity.yaml
helm --kube-context $K8S_CONTEXT install charts/bitcoind/ --namespace dev-btc-0 --name dev-btc-0 --values values-bitcoind.yaml
- Use
kubectl describe
to check/troubleshoot, for example:
kubectl --context $K8S_CONTEXT --namespace dev-eth-0 describe statefulset dev-eth-0-parity
kubectl --context $K8S_CONTEXT --namespace dev-eth-0 describe pod dev-eth-0-parity-0
Please check separate file for more details about additional troubleshooting.
TIP: when you need archive parity node to sync up faster - get a tons of RAM and preload synced blockchain into OS cache. My case was 640GB of RAM and blockchain preload from inside container via find | xargs cat > /dev/null
or vmtouch, 3-5x speedup from 0.5-2 blocks/sec(100-200 tx/sec) to 7-10 blocks/sec (700-1000 tx/sec) and sustained blockchain write near 150MB/s, just $1/hour with preemptible nodes.
You can use Cloud Build to update chart repository with these charts