diff --git a/charts/validator/Chart.yaml b/charts/validator/Chart.yaml index 4e72bfd..d12040d 100644 --- a/charts/validator/Chart.yaml +++ b/charts/validator/Chart.yaml @@ -20,7 +20,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: "0.8.2" +version: "0.9.0" # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/validator/README.md b/charts/validator/README.md index 3305d63..6c9f9bc 100644 --- a/charts/validator/README.md +++ b/charts/validator/README.md @@ -1,6 +1,6 @@ # validator -![Version: 0.8.2](https://img.shields.io/badge/Version-0.8.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.81.0](https://img.shields.io/badge/AppVersion-0.81.0-informational?style=flat-square) +![Version: 0.9.0](https://img.shields.io/badge/Version-0.9.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.81.0](https://img.shields.io/badge/AppVersion-0.81.0-informational?style=flat-square) A Helm chart for deploying Chronicle Validator on Kubernetes @@ -15,7 +15,7 @@ A Helm chart for deploying Chronicle Validator on Kubernetes | Key | Type | Default | Description | |-----|------|---------|-------------| | extraObjects | list | `[]` | Extra K8s manifests to deploy | -| ghost | object | `{"argsOverride":[],"commandOverride":[],"enabled":true,"env":{"normal":{},"raw":{}},"ethConfig":{},"image":{"repository":null,"tag":null},"rpcUrl":null,"service":{"annotations":{},"externalTrafficPolicy":"","loadBalancerClass":"","ports":{"libp2p":{"port":8000,"protocol":"TCP"}},"trafficDistribution":"","type":"LoadBalancer"},"watchdogConfigReg":"0x94Fea534aef6df5cF66C2DAE5CE0A05d10C068F3"}` | Values for Ghost | +| ghost | object | `{"argsOverride":[],"commandOverride":[],"enabled":true,"env":{"normal":{},"raw":{}},"ethConfig":{},"image":{"repository":null,"tag":null},"rpcUrl":null,"rpcUrlSecret":{"key":"","name":""},"service":{"annotations":{},"externalTrafficPolicy":"","loadBalancerClass":"","ports":{"libp2p":{"port":8000,"protocol":"TCP"}},"trafficDistribution":"","type":"LoadBalancer"},"watchdogConfigReg":"0x94Fea534aef6df5cF66C2DAE5CE0A05d10C068F3"}` | Values for Ghost | | ghost.argsOverride | list | `[]` | args override for the validator | | ghost.commandOverride | list | `[]` | command override for the validator | | ghost.enabled | bool | `true` | Whether to deploy the Ghost (defi) container/deployment. Set to `false` to run a single-container release (e.g. VAO-only). | @@ -23,6 +23,7 @@ A Helm chart for deploying Chronicle Validator on Kubernetes | ghost.env.normal | object | `{}` | un-encrypted env vars passed to the pod | | ghost.ethConfig | object | `{}` | Provide ETH keys from existing secrets : **NB** use only existing secret OR env vars, do not provide both | | ghost.image | object | `{"repository":null,"tag":null}` | Image tag for the validator (overrides global image if set) | +| ghost.rpcUrlSecret | object | `{"key":"","name":""}` | Read the Ghost container's CFG_CHAIN_RPC_URLS from an existing Secret instead of `ghost.rpcUrl`, for URLs that carry credentials such as an `api_key` query parameter. When `name` is set, `ghost.rpcUrl` is ignored and `key` is required. The VAO container inherits it when it sets neither `vao.rpcUrlSecret` nor `vao.rpcUrl`. | | ghost.service | object | `{"annotations":{},"externalTrafficPolicy":"","loadBalancerClass":"","ports":{"libp2p":{"port":8000,"protocol":"TCP"}},"trafficDistribution":"","type":"LoadBalancer"}` | Service type for the validator | | ghost.service.annotations | object | `{}` | Annotations to add to the service | | ghost.service.externalTrafficPolicy | string | `""` | Optional LoadBalancer traffic policy, for example Local. | @@ -78,7 +79,8 @@ A Helm chart for deploying Chronicle Validator on Kubernetes | vao.extraVolumes | list | `[]` | Extra volumes to mount (typically for secrets) | | vao.image | object | `{"repository":null,"tag":null}` | Image tag for the validator (overrides global image if set) | | vao.resources | object | `{}` | Resources constraints for the validator, CPU, Memory, etc. | -| vao.rpcUrl | string | `nil` | Chain RPC URL(s) for the VAO container's target chain. Falls back to `ghost.rpcUrl` when unset (pre-0.8.0 behavior). | +| vao.rpcUrl | string | `nil` | Chain RPC URL(s) for the VAO container's target chain. When neither this nor `vao.rpcUrlSecret` is set, the VAO container uses the Ghost settings, `ghost.rpcUrlSecret` then `ghost.rpcUrl` (pre-0.8.0 behavior). | +| vao.rpcUrlSecret | object | `{"key":"","name":""}` | Read the VAO container's CFG_CHAIN_RPC_URLS from an existing Secret instead of `vao.rpcUrl`. When `name` is set, `vao.rpcUrl` is ignored and `key` is required. | | vao.service | object | `{"annotations":{},"externalTrafficPolicy":"","loadBalancerClass":"","ports":{"libp2p":{"port":8001,"protocol":"TCP"}},"trafficDistribution":"","type":"LoadBalancer"}` | Service type for the validator | | vao.service.annotations | object | `{}` | Annotations to add to the service | | vao.service.externalTrafficPolicy | string | `""` | Optional LoadBalancer traffic policy, for example Local. | diff --git a/charts/validator/ci/testnet-envs-values.yaml b/charts/validator/ci/testnet-envs-values.yaml index 81c5cf7..09c744b 100644 --- a/charts/validator/ci/testnet-envs-values.yaml +++ b/charts/validator/ci/testnet-envs-values.yaml @@ -10,7 +10,12 @@ global: chainName: sep ghost: watchdogConfigReg: "0xE1CcD31f46F30A764DbACB4759E69d8799126941" - rpcUrl: https://0xrpc.io/sep + # CFG_CHAIN_RPC_URLS comes from the test-rpc Secret below, and VAO inherits it. + # mainnet-envs-values.yaml covers the plain rpcUrl path. + rpcUrl: "" + rpcUrlSecret: + name: test-rpc + key: CFG_CHAIN_RPC_URLS service: # -- Type of service for the validator, can also be `LoadBalancer` @@ -73,6 +78,13 @@ extraObjects: type: Opaque stringData: keyfile: "{}" + - apiVersion: v1 + kind: Secret + metadata: + name: test-rpc + type: Opaque + stringData: + CFG_CHAIN_RPC_URLS: https://0xrpc.io/sep - apiVersion: v1 kind: ConfigMap metadata: diff --git a/charts/validator/templates/_helpers.tpl b/charts/validator/templates/_helpers.tpl index f241bbd..00e4f7b 100644 --- a/charts/validator/templates/_helpers.tpl +++ b/charts/validator/templates/_helpers.tpl @@ -74,3 +74,21 @@ Create the name of the service account to use {{- default "default" .Values.global.serviceAccount.name }} {{- end }} {{- end }} + +{{/* +CFG_CHAIN_RPC_URLS source for one container: valueFrom.secretKeyRef when the +Secret ref has a name, else the plain URL. Takes a dict with "secret" (an +rpcUrlSecret map, may be nil), "url" (the plain rpcUrl) and "path" (the values +path, for the error message). +*/}} +{{- define "validator.rpcUrlEnvSource" -}} +{{- $secret := .secret | default dict -}} +{{- if $secret.name -}} +valueFrom: + secretKeyRef: + name: {{ $secret.name | quote }} + key: {{ required (printf "%s.key is required when %s.name is set" .path .path) $secret.key | quote }} +{{- else -}} +value: {{ .url | quote }} +{{- end -}} +{{- end }} diff --git a/charts/validator/templates/deployment-vao.yaml b/charts/validator/templates/deployment-vao.yaml index de423d7..e3b7182 100644 --- a/charts/validator/templates/deployment-vao.yaml +++ b/charts/validator/templates/deployment-vao.yaml @@ -105,8 +105,13 @@ spec: - name: CFG_CHAIN_ID value: {{ .Values.global.chainId | default "1" | quote }} - name: CFG_CHAIN_RPC_URLS - {{- /* vao.rpcUrl falls back to ghost.rpcUrl to preserve pre-0.8.0 behavior for releases that only set the ghost value */}} - value: {{ .Values.vao.rpcUrl | default .Values.ghost.rpcUrl | quote }} + {{- /* VAO uses its own rpcUrlSecret/rpcUrl when either is set, else the ghost pair (pre-0.8.0 behavior for releases that only set the ghost values). Within a pair the Secret wins. */}} + {{- $vaoRpcUrlSecret := .Values.vao.rpcUrlSecret | default dict }} + {{- $rpcSrc := dict "secret" .Values.ghost.rpcUrlSecret "url" .Values.ghost.rpcUrl "path" "ghost.rpcUrlSecret" }} + {{- if or $vaoRpcUrlSecret.name .Values.vao.rpcUrl }} + {{- $rpcSrc = dict "secret" $vaoRpcUrlSecret "url" .Values.vao.rpcUrl "path" "vao.rpcUrlSecret" }} + {{- end }} + {{- include "validator.rpcUrlEnvSource" $rpcSrc | nindent 14 }} {{- if .Values.global.chainTxType }} - name: CFG_CHAIN_TX_TYPE value: {{ .Values.global.chainTxType | default "eip1559" | quote }} diff --git a/charts/validator/templates/deployment.yaml b/charts/validator/templates/deployment.yaml index cd2fdee..45aba3e 100644 --- a/charts/validator/templates/deployment.yaml +++ b/charts/validator/templates/deployment.yaml @@ -107,7 +107,7 @@ spec: - name: CFG_CHAIN_ID value: {{ .Values.global.chainId | default "1" | quote }} - name: CFG_CHAIN_RPC_URLS - value: {{ .Values.ghost.rpcUrl | quote }} + {{- include "validator.rpcUrlEnvSource" (dict "secret" .Values.ghost.rpcUrlSecret "url" .Values.ghost.rpcUrl "path" "ghost.rpcUrlSecret") | nindent 14 }} {{- if .Values.global.chainTxType }} - name: CFG_CHAIN_TX_TYPE value: {{ .Values.global.chainTxType | default "eip1559" | quote }} diff --git a/charts/validator/values.yaml b/charts/validator/values.yaml index 068736d..275e9a0 100644 --- a/charts/validator/values.yaml +++ b/charts/validator/values.yaml @@ -149,6 +149,10 @@ ghost: tag: null # Deprecated: use `chainRpcUrl` instead - remove after FINSHED release rpcUrl: null + # -- Read the Ghost container's CFG_CHAIN_RPC_URLS from an existing Secret instead of `ghost.rpcUrl`, for URLs that carry credentials such as an `api_key` query parameter. When `name` is set, `ghost.rpcUrl` is ignored and `key` is required. The VAO container inherits it when it sets neither `vao.rpcUrlSecret` nor `vao.rpcUrl`. + rpcUrlSecret: + name: "" + key: "" # -- WATCHDOG onchain config address watchdogConfigReg: "0x94Fea534aef6df5cF66C2DAE5CE0A05d10C068F3" @@ -227,8 +231,12 @@ vao: image: repository: null tag: null - # -- Chain RPC URL(s) for the VAO container's target chain. Falls back to `ghost.rpcUrl` when unset (pre-0.8.0 behavior). + # -- Chain RPC URL(s) for the VAO container's target chain. When neither this nor `vao.rpcUrlSecret` is set, the VAO container uses the Ghost settings, `ghost.rpcUrlSecret` then `ghost.rpcUrl` (pre-0.8.0 behavior). rpcUrl: null + # -- Read the VAO container's CFG_CHAIN_RPC_URLS from an existing Secret instead of `vao.rpcUrl`. When `name` is set, `vao.rpcUrl` is ignored and `key` is required. + rpcUrlSecret: + name: "" + key: "" # -- WATCHDOG onchain config address watchdogConfigReg: "0x064358f9b6428C51F80511D73AFEb3A9e5Cf0213" # -- WATCHDOG polling interval (in seconds)