Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(proxyd): added sections to config interface #176

Merged
merged 1 commit into from Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/proxyd/Chart.yaml
Expand Up @@ -15,7 +15,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.3.4
version: 0.4.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
Expand Down
5 changes: 4 additions & 1 deletion charts/proxyd/README.md
Expand Up @@ -2,7 +2,7 @@

Deploy and scale [proxyd](https://github.com/ethereum-optimism/optimism/tree/develop/proxyd) inside Kubernetes with ease

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) ![Version: 0.3.3](https://img.shields.io/badge/Version-0.3.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v4.4.1](https://img.shields.io/badge/AppVersion-v4.4.1-informational?style=flat-square)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) ![Version: 0.4.0](https://img.shields.io/badge/Version-0.4.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v4.4.1](https://img.shields.io/badge/AppVersion-v4.4.1-informational?style=flat-square)

## Introduction

Expand Down Expand Up @@ -126,6 +126,7 @@ We do not recommend that you upgrade the application by overriding `image.tag`.

| Key | Description | Type | Default |
|-----|-------------|------|---------|
| backendConfig | TOML configuration for backend | string | `"# How long proxyd should wait for a backend response before timing out.\nresponse_timeout_seconds = 300\n# Maximum response size, in bytes, that proxyd will accept from a backend.\nmax_response_size_bytes = 10737420000 # 10 GiB\n# Maximum number of times proxyd will try a backend before giving up.\nmax_retries = 3\n# Number of seconds to wait before trying an unhealthy backend again.\nout_of_service_seconds = 10\n"` |
| backends.example-backend | Example backend configuration, keep disabled | object | `{"enabled":false,"extraConfig":{},"groups":["pruned","archive","archive-trace"],"rpcUrl":"http://your-node:8545"}` |
| backends.example-backend.enabled | Enable the backend | bool | `false` |
| backends.example-backend.extraConfig | Define additional configuration keys for the backend (see [proxyd config](https://github.com/ethereum-optimism/optimism/blob/5d309e6a6d5e1ef6a88c1ce827b7e6d47f033bbb/proxyd/example.config.toml#L47)) | object | `{}` |
Expand All @@ -140,6 +141,7 @@ We do not recommend that you upgrade the application by overriding `image.tag`.
| image.repository | Image for proxyd | string | `"us-docker.pkg.dev/oplabs-tools-artifacts/images/proxyd"` |
| image.tag | Overrides the image tag | string | Chart.appVersion |
| imagePullSecrets | Pull secrets required to fetch the Image | list | `[]` |
| metricsConfig | TOML configuration for metrics | string | `"# Whether or not to enable Prometheus metrics.\nenabled = true\n# Host for the Prometheus metrics endpoint to listen on.\nhost = \"0.0.0.0\"\n# Port for the above.\nport = 9761\n"` |
| nameOverride | | string | `""` |
| prometheus.serviceMonitors.enabled | Enable monitoring by creating `ServiceMonitor` CRDs ([prometheus-operator](https://github.com/prometheus-operator/prometheus-operator)) | bool | `false` |
| prometheus.serviceMonitors.interval | | string | `nil` |
Expand All @@ -161,6 +163,7 @@ We do not recommend that you upgrade the application by overriding `image.tag`.
| proxyd.terminationGracePeriodSeconds | Amount of time to wait before force-killing the proxyd process | int | `60` |
| proxyd.tolerations | | list | `[]` |
| rpcMethodMappings | Mapping JSON-RPC method name to a particular group of backends (method_name -> group_name) | object | `{"eth_blockNumber":"pruned","eth_call":"archive","eth_chainId":"pruned","eth_coinbase":"pruned","eth_estimateGas":"pruned","eth_feeHistory":"pruned","eth_gasPrice":"pruned","eth_getBalance":"pruned","eth_getBlockByHash":"pruned","eth_getBlockByNumber":"pruned","eth_getBlockTransactionCountByHash":"pruned","eth_getBlockTransactionCountByNumber":"pruned","eth_getCode":"pruned","eth_getFilterChanges":"pruned","eth_getLogs":"pruned","eth_getStorageAt":"pruned","eth_getTransactionByBlockHashAndIndex":"archive","eth_getTransactionByBlockNumberAndIndex":"archive","eth_getTransactionByHash":"archive","eth_getTransactionCount":"pruned","eth_getTransactionReceipt":"archive","eth_getUncleByBlockHashAndIndex":"pruned","eth_getUncleByBlockNumberAndIndex":"pruned","eth_newBlockFilter":"pruned","eth_newFilter":"pruned","eth_newPendingTransactionFilter":"pruned","eth_protocolVersion":"pruned","eth_sendRawTransaction":"pruned","eth_sendTransaction":"pruned","eth_sign":"pruned","eth_uninstallFilter":"pruned","net_version":"pruned","trace_block":"archive-trace","trace_call":"archive-trace","trace_callMany":"archive-trace","trace_filter":"archive-trace","trace_rawTransaction":"archive-trace","trace_replayBlockTransactions":"archive-trace","trace_replayTransaction":"archive-trace","trace_transaction":"archive-trace","web3_clientVersion":"pruned","web3_sha3":"pruned"}` |
| serverConfig | TOML configuration for server | string | `"# Host for the proxyd RPC server to listen on\nrpc_host = \"0.0.0.0\"\n# Port for the above.\nrpc_port = 8545\n# Maximum client body size, in bytes, that the server will accept\nmax_body_size_bytes = 10737420000 # 10 GiB\n# Maximum number of concurrent RPCs that the server will accept\nmax_concurrent_rpcs = 0 # unlimited\n# Timeout for requests\ntimeout_seconds = 300\n"` |
| serviceAccount.annotations | Annotations to add to the service account | object | `{}` |
| serviceAccount.create | Specifies whether a service account should be created | bool | `true` |
| serviceAccount.name | The name of the service account to use. If not set and create is true, a name is generated using the fullname template | string | `""` |
Expand Down
47 changes: 30 additions & 17 deletions charts/proxyd/values.yaml
Expand Up @@ -162,37 +162,50 @@ rpcMethodMappings:
trace_replayBlockTransactions: archive-trace
trace_replayTransaction: archive-trace

# -- The configuration template that is rendered by Helm
# @default -- See default template in [values.yaml](values.yaml)
configTemplate: |
[server]
# Host for the proxyd RPC server to listen on.
# -- TOML configuration for server
serverConfig: |
# Host for the proxyd RPC server to listen on
rpc_host = "0.0.0.0"
# Port for the above.
rpc_port = 8545
# Maximum client body size, in bytes, that the server will accept.
max_body_size_bytes = 104857600 # 100 MiB
max_concurrent_rpcs = 0
# Maximum client body size, in bytes, that the server will accept
max_body_size_bytes = 10737420000 # 10 GiB
# Maximum number of concurrent RPCs that the server will accept
max_concurrent_rpcs = 0 # unlimited
# Timeout for requests
timeout_seconds = 300

[metrics]
# -- TOML configuration for backend
backendConfig: |
# How long proxyd should wait for a backend response before timing out.
response_timeout_seconds = 300
# Maximum response size, in bytes, that proxyd will accept from a backend.
max_response_size_bytes = 10737420000 # 10 GiB
# Maximum number of times proxyd will try a backend before giving up.
max_retries = 3
# Number of seconds to wait before trying an unhealthy backend again.
out_of_service_seconds = 10

# -- TOML configuration for metrics
metricsConfig: |
# Whether or not to enable Prometheus metrics.
enabled = true
# Host for the Prometheus metrics endpoint to listen on.
host = "0.0.0.0"
# Port for the above.
port = 9761

# -- The configuration template that is rendered by Helm
# @default -- See default template in [values.yaml](values.yaml)
configTemplate: |
[server]
{{ .Values.serverConfig }}

[metrics]
{{ .Values.metricsConfig }}

[backend]
# How long proxyd should wait for a backend response before timing out.
response_timeout_seconds = 300
# Maximum response size, in bytes, that proxyd will accept from a backend.
max_response_size_bytes = 104857600 # 100 MiB
# Maximum number of times proxyd will try a backend before giving up.
max_retries = 3
# Number of seconds to wait before trying an unhealthy backend again.
out_of_service_seconds = 10
{{ .Values.backendConfig }}

[backends]
{{- range $backendName, $backendValues := .Values.backends }}
Expand Down