Back to Aptos Core

aptos-node

terraform/helm/aptos-node/README.md

latest11.5 KB
Original Source

aptos-node

Aptos blockchain node deployment

Homepage: https://aptoslabs.com/

Source Code

Values

KeyTypeDefaultDescription
chain.chain_idint4Chain ID
chain.eraint1Bump this number to wipe the underlying storage
chain.namestring"testnet"Internal: name of the testnet to connect to
cluster_namestring"unknown"
enablePrivilegedModeboolfalseTEST ONLY: Enable running as root for profiling
fullnode.affinityobject{}
fullnode.configobject{"full_node_networks":[{"network_id":"public"}]}Fullnode configuration. See NodeConfig https://github.com/aptos-labs/aptos-core/blob/main/config/src/config/mod.rs
fullnode.force_enable_telemetryboolfalseFlag to force enable telemetry service (useful for forge tests)
fullnode.groupslist[{"dns_name":"vfn","name":"fullnode","replicas":1}]Specify fullnode groups by name and number of replicas
fullnode.nodeSelectorobject{}
fullnode.podAnnotationsstringnil
fullnode.resources.limits.cpuint30
fullnode.resources.limits.memorystring"60Gi"
fullnode.resources.requests.cpuint30
fullnode.resources.requests.memorystring"60Gi"
fullnode.rust_logstring"info"Log level for the fullnode
fullnode.storage.classstringnilKubernetes storage class to use for fullnode persistent storage
fullnode.storage.sizestring"2048Gi"Size of fullnode persistent storage
fullnode.tolerationslist[]
genesis_blob_upload_urlstring"https://us-west1-aptos-forge-gcp-0.cloudfunctions.net/signed-url?cluster_name=unknown&era=1"
haproxy.affinityobject{}
haproxy.config.send_proxy_protocolboolfalseWhether to send Proxy Protocol v2
haproxy.config.userstring"nobody"System user to run HA
haproxy.enabledbooltrueEnable HAProxy deployment in front of validator and fullnodes
haproxy.image.pullPolicystring"IfNotPresent"Image pull policy to use for HAProxy images
haproxy.image.repostring"haproxy"Image repo to use for HAProxy images
haproxy.image.tagstring"3.0.2@sha256:3fa2e323a2f422239a39eff345b41ab20a7a91aa4ad8c3c82b9ae85dd241214b"Image tag to use for HAProxy images
haproxy.nodeSelectorobject{}
haproxy.replicasint1Number of HAProxy replicas
haproxy.resources.limits.cpuint7
haproxy.resources.limits.memorystring"16Gi"
haproxy.resources.requests.cpuint7
haproxy.resources.requests.memorystring"16Gi"
haproxy.tls_secretstringnilName of the Kubernetes TLS secret to use for HAProxy
haproxy.tolerationslist[]
imageTagstring"devnet"Default image tag to use for all validator and fullnode images
labelsstringnil
loadTestGenesisboolfalseLoad test-data for starting a test network
manageImagesbooltrueIf true, helm will always override the deployed image with what is configured in the helm values. If not, helm will take the latest image from the currently running workloads, which is useful if you have a separate procedure to update images (e.g. rollout)
metrics.destinationstring"dev"The upstream sink for metrics. Supported values are "dev" and "prod"
migrations.enable_vfn_explicit_pvcboolfalseSee templates/fullnode.yaml
multiclusterobject{"enabled":false,"targetClusters":["forge-multiregion-1","forge-multiregion-2","forge-multiregion-3"]}Options for multicluster mode. This is experimental only.
numFullnodeGroupsint1Total number of fullnode groups to deploy
numValidatorsint1Number of validators to deploy
overrideNodeConfigboolfalseSpecify validator and fullnode NodeConfigs via named ConfigMaps, rather than the generated ones from this chart.
service.domainstringnilIf set, the base domain name to use for External DNS
service.fullnode.enableAdminPortboolfalseEnable the admin port on fullnodes
service.fullnode.enableMetricsPortboolfalseEnable the metrics port on fullnodes
service.fullnode.enableRestApibooltrueEnable the REST API on fullnodes
service.fullnode.external.typestring"LoadBalancer"The Kubernetes ServiceType to use for fullnodes' HAProxy
service.fullnode.externalTrafficPolicystring"Local"The externalTrafficPolicy for the fullnode service
service.fullnode.internal.annotationsobject{}
service.fullnode.internal.headlessboolfalse
service.fullnode.internal.typestring"ClusterIP"The Kubernetes ServiceType to use for fullnodes
service.fullnode.loadBalancerSourceRangesstringnilIf set and if the ServiceType is LoadBalancer, allow traffic to fullnodes from these CIDRs
service.internalDomainstringnilIf set, the base domain name to use for internal LBs
service.validator.enableAdminPortboolfalseEnable the admin port on the validator
service.validator.enableMetricsPortboolfalseEnable the metrics port on the validator
service.validator.enableRestApibooltrueEnable the REST API on the validator
service.validator.external.typestring"LoadBalancer"The Kubernetes ServiceType to use for validator's HAProxy
service.validator.externalTrafficPolicystring"Local"The externalTrafficPolicy for the validator service
service.validator.internal.annotationsobject{}
service.validator.internal.headlessboolfalse
service.validator.internal.typestring"ClusterIP"The Kubernetes ServiceType to use for validator
service.validator.loadBalancerSourceRangesstringnilIf set and if the ServiceType is LoadBalancer, allow traffic to validators from these CIDRs
serviceAccount.createbooltrueSpecifies whether a service account should be created
serviceAccount.namestringnilThe name of the service account to use. If not set and create is true, a name is generated using the fullname template
validator.affinityobject{}
validator.configobject{}Validator configuration. See NodeConfig https://github.com/aptos-labs/aptos-core/blob/main/config/src/config/mod.rs
validator.enableNetworkPolicyboolfalseLock down network ingress and egress with Kubernetes NetworkPolicy
validator.force_enable_telemetryboolfalseFlag to force enable telemetry service (useful for forge tests)
validator.image.pullPolicystring"IfNotPresent"Image pull policy to use for validator images
validator.image.repostring"aptoslabs/validator"Image repo to use for validator images
validator.image.tagstringnilImage tag to use for validator images. If set, overrides imageTag
validator.namestringnilInternal: name of your validator for use in labels
validator.nodeSelectorobject{}
validator.podAnnotationsstringnil
validator.resources.limits.cpuint30
validator.resources.limits.memorystring"60Gi"
validator.resources.requests.cpuint30
validator.resources.requests.memorystring"60Gi"
validator.rust_logstring"info"Log level for the validator
validator.storage.classstringnilKubernetes storage class to use for validator persistent storage
validator.storage.sizestring"2048Gi"Size of validator persistent storage
validator.tolerationslist[]
validator.useConsensusHealthCheckAsStartupProbeboolfalse

Resource Descriptions

Below is a list of the Kubernetes resources created by this helm chart.

The resources created by this helm chart will be prefixed with the helm release name. Below, they are denoted by the <RELEASE_NAME> prefix.

StatefulSets:

  • <RELEASE_NAME>-aptos-node-0-validator - The validator StatefulSet
  • <RELEASE_NAME>-aptos-node-0-fullnode-e<ERA> - The fullnode StatefulSet

Deployments:

  • <RELEASE_NAME>-aptos-node-0-validator - The HAProxy deployment

PersistentVolumeClaim:

  • <RELEASE_NAME>-0-validator-e<ERA> - The validator PersistentVolumeClaim
  • fn-<RELEASE_NAME>-0-fullnode-e<ERA>-0 - The fullnode PersistentVolumeClaim. Note the difference in naming scheme between valdiator and fullnode PVC, which is due to the fact that you can spin up multiple fullnodes, but only a single validator.

Services:

  • <RELEASE_NAME>-aptos-node-0-validator-lb - Inbound load balancer service that routes to the validator
  • <RELEASE_NAME>-aptos-node-0-fullnode-lb - Inbound load balancer service that routes to the fullnode

ConfigMaps:

  • <RELEASE_NAME>-0 - The validator and fullnode NodeConfigs
  • <RELEASE_NAME>-0-haproxy - The HAProxy configuration

NetworkPolicies:

  • <RELEASE_NAME>-0-validator - The validator NetworkPolicy, which controls network access to the validator pods

ServiceAccounts:

  • [optional] <RELEASE_NAME> - The default service account
  • <RELEASE_NAME>-validator - The validator service account
  • <RELEASE_NAME>-fullnode - The fullnode service account

[optional] PodSecurityPolicy:

  • <RELEASE_NAME> - The default PodSecurityPolicy for validators and fullnodes
  • <RELEASE_NAME>-haproxy - The PodSecurityPolicy for HAProxy

Common Operations

Check Pod Status

$ kubectl get pods

You should see at least 1/1 replicas running for the validator, fullnode, and HAProxy. If there are any restarts, you should see it in this view.

To see more details about a singular pod, you can describe it:

$ kubectl describe pod <POD_NAME>

Check the Pod Logs

$ kubectl logs <POD_NAME>

Check all services

$ kubectl get services

By default, the services are LoadBalancer type, which means that they will be accessible from the outside world. Depending on your kubernetes deployment/cloud, the public IP or DNS information will be displayed.

Scale Down Workloads

If you want to temporarily remove some of the workloads, you can scale them down.

# scale down the validator
kubectl scale statefulset <STS_NAME> --replicas=0

Advanced Options

Testnet Mode (Multiple Validators and Fullnodes)

For testing purposes, you may deploy multiple validators into the same cluster via .Values.numValidators. The naming convention is <RELEASE_NAME>-aptos-node-<INDEX>-validator, where <INDEX> is the index of the validator. Note that for each validator, you must provide genesis ConfigMaps for each, of the name: <RELEASE_NAME>-<INDEX>-genesis-e<ERA>. You may also deploy multiple fullnodes into the cluster via .Values.numFullnodeGroups and .Values.fullnode.groups. Each validator can have multiple fullnode groups, each with multiple replicas. The total number of fullnode groups can be limited via .Values.numFullnodeGroups.

Era

The .Values.chain.era is a number that is incremented every time the validator's storage is wiped. This is useful for testnets when the network is wiped.

Privileged Mode

For debugging purposes, it's sometimes useful to run the validator as root (privileged mode). This is enabled by .Values.enablePrivilegedMode.