charon-cluster
by Obol Labs
Charon is an open-source Ethereum Distributed validator middleware written in golang. This chart deploys a full Charon cluster.
About this chart
Charon Cluster
Charon is an open-source Ethereum Distributed validator middleware written in golang. This chart deploys a full Charon cluster.
Homepage: https://obol.tech/
Source Code
Values
| Key | Type | Default | Description |
|---|---|---|---|
| affinity | object | {} | Affinity for pod assignment # ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity # # Example: # affinity: # podAntiAffinity: # requiredDuringSchedulingIgnoredDuringExecution: # - labelSelector: # matchExpressions: # - key: app.kubernetes.io/name # operator: In # values: # - charon # topologyKey: kubernetes.io/hostname # |
| centralMonitoring | object | {"enabled":false,"promEndpoint":"https://vm.monitoring.gcp.obol.tech/write","token":""} | Central Monitoring |
| centralMonitoring.enabled | bool | false | Specifies whether central monitoring should be enabled |
| centralMonitoring.promEndpoint | string | "https://vm.monitoring.gcp.obol.tech/write" | https endpoint to obol central prometheus |
| centralMonitoring.token | string | "" | The authentication token to the central prometheus |
| clusterSize | int | 4 | The number of charon nodes in the cluster. Minimum is 4 |
| clusterThreshold | int | 3 | Cluster threshold required for signature reconstruction. Defaults to ceil(n*2/3) if zero. Warning, non-default values decrease security. |
| config.LockFile | string | "/charon/cluster-lock.json" | The path to the cluster lock file defining distributed validator cluster. (default ".charon/cluster-lock.json") |
| config.beaconNodeEndpoints | string | "" | Comma separated list of one or more beacon node endpoint URLs. |
| config.builderApi | string | "" | Enables the builder api. Will only produce builder blocks. Builder API must also be enabled on the validator client. Beacon node must be connected to a builder-relay to access the builder network. |
| config.directConnectionEnabled | string | "true" | If enabled, it will set p2pExternalHostname value to the pod name and enable direct connection between cluster nodes |
| config.featureSet | string | "stable" | Minimum feature set to enable by default: alpha, beta, or stable. Warning: modify at own risk. (default "stable") |
| config.featureSetDisable | string | "" | Comma-separated list of features to disable, overriding the default minimum feature set. |
| config.featureSetEnable | string | "" | Comma-separated list of features to enable, overriding the default minimum feature set. |
| config.jaegerAddress | string | "jaeger:6831" | Listening address for jaeger tracing. |
| config.jaegerService | string | "" | Service name used for jaeger tracing. |
| config.logFormat | string | "json" | Log format; console, logfmt or json (default "console") |
| config.logLevel | string | "info" | Log level; debug, info, warn or error (default "info") |
| config.lokiAddresses | string | "" | Enables sending of logfmt structured logs to these Loki log aggregation server addresses. This is in addition to normal stderr logs. |
| config.lokiService | string | "" | Service label sent with logs to Loki. |
| config.monitoringAddress | string | "0.0.0.0:3620" | Listening address (ip and port) for the monitoring API (prometheus, pprof). (default "127.0.0.1:3620") |
| config.noVerify | bool | false | Disables cluster definition and lock file verification. |
| config.p2pAllowlist | string | "" | Comma-separated list of CIDR subnets for allowing only certain peer connections. Example: 192.168.0.0/16 would permit connections to peers on your local network only. The default is to accept all connections. |
| config.p2pDenylist | string | "" | Comma-separated list of CIDR subnets for disallowing certain peer connections. Example: 192.168.0.0/16 would disallow connections to peers on your local network. The default is to accept all connections. |
| config.p2pDisableReuseport | string | "" | Disables TCP port reuse for outgoing libp2p connections. |
| config.p2pExternalHostname | string | "" | The DNS hostname advertised by libp2p. This may be used to advertise an external DNS. |
| config.p2pExternalIp | string | "" | The IP address advertised by libp2p. This may be used to advertise an external IP. |
| config.p2pRelays | string | "" | Comma-separated list of libp2p relay URLs or multiaddrs. (default [https://0.relay.obol.tech/enr]) |
| config.p2pTcpAddress | string | "0.0.0.0:3610" | Comma-separated list of listening TCP addresses (ip and port) for libP2P traffic. Empty default doesn't bind to local port therefore only supports outgoing connections. |
| config.simnetBeaconMock | string | "" | Enables an internal mock beacon node for running a simnet. |
| config.simnetValidatorKeysDir | string | "" | The directory containing the simnet validator key shares. (default ".charon/validator_keys") |
| config.simnetValidatorMock | string | "" | Enables an internal mock validator client when running a simnet. Requires simnet-beacon-mock. |
| config.syntheticBlockProposals | string | "" | Enables additional synthetic block proposal duties. Used for testing of rare duties. |
| config.validatorApiAddress | string | "0.0.0.0:3600" | Listening address (ip and port) for validator-facing traffic proxying the beacon-node API. (default "127.0.0.1:3600") |
| containerSecurityContext | object | See values.yaml | The security context for containers |
| fullnameOverride | string | "" | Provide a name to substitute for the full names of resources |
| image | object | {"pullPolicy":"IfNotPresent","repository":"obolnetwork/charon","tag":"v1.11.3"} | Charon image repository, pull policy, and tag version |
| imagePullSecrets | list | [] | Credentials to fetch images from private registry # ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ |
| livenessProbe | object | {"enabled":false,"httpGet":{"path":"/livez"},"initialDelaySeconds":10,"periodSeconds":5} | Configure liveness probes # ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/ |
| nameOverride | string | "" | Provide a name in place of lighthouse for app: labels |
| nodeSelector | object | {} | Node labels for pod assignment # ref: https://kubernetes.io/docs/user-guide/node-selection/ |
| podAnnotations | object | {} | Pod annotations |
| podDisruptionBudget | object | {"enabled":true,"minAvailable":""} | Enable pod disruption budget # ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb |
| priorityClassName | string | "" | Used to assign priority to pods # ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/ |
| rbac | object | {"clusterRules":[{"apiGroups":[""],"resources":["nodes"],"verbs":["get","list","watch"]}],"enabled":true,"name":"","rules":[{"apiGroups":[""],"resources":["services"],"verbs":["get","list","watch"]}]} | RBAC configuration. # ref: https://kubernetes.io/docs/reference/access-authn-authz/rbac/ |
| rbac.clusterRules | list | [{"apiGroups":[""],"resources":["nodes"],"verbs":["get","list","watch"]}] | Required ClusterRole rules |
| rbac.clusterRules[0] | object | {"apiGroups":[""],"resources":["nodes"],"verbs":["get","list","watch"]} | Required to obtain the nodes external IP |
| rbac.enabled | bool | true | Specifies whether RBAC resources are to be created |
| rbac.name | string | "" | The name of the cluster role to use. If not set and create is true, a name is generated using the fullname template |
| rbac.rules | list | [{"apiGroups":[""],"resources":["services"],"verbs":["get","list","watch"]}] | Required Role rules |
| rbac.rules[0] | object | {"apiGroups":[""],"resources":["services"],"verbs":["get","list","watch"]} | Required to get information about the serices nodePort. |
| readinessProbe | object | {"enabled":false,"httpGet":{"path":"/readyz"},"initialDelaySeconds":5,"periodSeconds":3} | Configure readiness probes # ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/ |
| resources | object | {} | Pod resources limits and requests |
| secrets | object | {"clusterlock":"cluster-lock","enrPrivateKey":"charon-enr-private-key","validatorKeys":"validators"} | Kubernetes secrets names |
| secrets.clusterlock | string | "cluster-lock" | charon cluster lock |
| secrets.enrPrivateKey | string | "charon-enr-private-key" | charon enr private key |
| secrets.validatorKeys | string | "validators" | validators keys |
| securityContext | object | See values.yaml | The security context for pods |
| service | object | {"clusterIP":"None","ports":{"monitoring":{"name":"monitoring","port":3620,"protocol":"TCP","targetPort":3620},"p2pTcp":{"name":"p2p-tcp","port":3610,"protocol":"TCP","targetPort":3610},"validatorApi":{"name":"validator-api","port":3600,"protocol":"TCP","targetPort":3600}}} | Charon service ports |
| service.clusterIP | string | "None" | Headless service to create DNS for each statefulset instance |
| serviceAccount | object | {"annotations":{},"enabled":true,"name":""} | Service account # ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/ |
| serviceAccount.annotations | object | {} | Annotations to add to the service account |
| serviceAccount.enabled | bool | true | Specifies whether a service account should be created |
| serviceAccount.name | string | "" | The name of the service account to use. If not set and create is true, a name is generated using the default template |
| serviceMonitor | object | {"annotations":{},"enabled":true,"interval":"1m","labels":{},"namespace":"","path":"/metrics","relabelings":[],"scheme":"http","scrapeTimeout":"30s","tlsConfig":{}} | Prometheus Service Monitor # ref: https://github.com/coreos/prometheus-operator |
| serviceMonitor.annotations | object | {} | Additional ServiceMonitor annotations |
| serviceMonitor.enabled | bool | true | If true, a ServiceMonitor CRD is created for a prometheus operator. https://github.com/coreos/prometheus-operator |
| serviceMonitor.interval | string | "1m" | ServiceMonitor scrape interval |
| serviceMonitor.labels | object | {} | Additional ServiceMonitor labels |
| serviceMonitor.namespace | string | "" | Alternative namespace for ServiceMonitor |
| serviceMonitor.path | string | "/metrics" | Path to scrape |
| serviceMonitor.relabelings | list | [] | ServiceMonitor relabelings |
| serviceMonitor.scheme | string | "http" | ServiceMonitor scheme |
| serviceMonitor.scrapeTimeout | string | "30s" | ServiceMonitor scrape timeout |
| serviceMonitor.tlsConfig | object | {} | ServiceMonitor TLS configuration |
| tolerations | object | {} | Tolerations for pod assignment # ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ |
| updateStrategy | string | "RollingUpdate" | allows you to configure and disable automated rolling updates for containers, labels, resource request/limits, and annotations for the Pods in a StatefulSet. |
How to use this chart
A distributed validator cluster is composed of the following containers:
- Single execution layer client
- Single consensus layer client
- Number of Distributed Validator clients [This chart]
- Number of Validator clients
- Prometheus, Grafana and Jaeger clients for monitoring this cluster.
Prerequisites
You have the following charon artifacts created as k8s secrets per each charon node:
<cluster-name>-<node-index>-validatorsi.echaron-cluster-0-validators<cluster-name>-<node-index>-charon-enr-private-keyi.echaron-cluster-0-charon-enr-private-keyThe cluster lock is a single secret for the whole cluster:cluster-lock
e.g. with node0:
kubectl create secret generic charon-enr-private-key --from-file=cluster/node0/charon-enr-private-key
kubectl create secret generic cluster-lock --from-file=node0/cluster-lock.json
kubectl create secret generic validator-keys --from-file=keystore-0.json=cluster/node0/validator_keys/keystore-0.json --from-file=keystore-0.txt=cluster/node0/validator_keys/keystore-0.txt
List of secrets for a cluster `charon-cluster` with 4 nodes are:
```console
charon-cluster-0-charon-enr-private-key
charon-cluster-0-validators
charon-cluster-1-charon-enr-private-key
charon-cluster-1-validators
charon-cluster-2-charon-enr-private-key
charon-cluster-2-validators
charon-cluster-3-charon-enr-private-key
charon-cluster-3-validators
cluster-lock
Add Obol's Helm Charts Repo
helm repo add obol https://obolnetwork.github.io/helm-charts
helm repo update
See helm repo for command documentation.
Install the chart
Install a charon cluster charon-cluster with 4 nodes:
helm upgrade --install charon-cluster obol/charon-cluster \
--set='clusterSize=4' \
--set='config.beaconNodeEndpoints=<BEACON_NODES_ENDPOINTS>' \
--create-namespace \
--namespace $CHARON_NODE_NAMESPACE
Connect the validator client
- Update each validator client to connect to charon node API endpoint instead of the beacon node endpoint
--beacon-node-api-endpoint="http://CHARON_NODE_SERVICE_NAME:3600" - Mount each of the
<cluster-name>-<node-index>-validatorsk8s secrets to the validator client validators folder.
Example of a single teku deployment that pairs
Deploy charon-cluster with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has charon-cluster on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartcharon-cluster is pinned at v0.6.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply