Skip to content

Commit ec30602

Browse files
add web3signer helm chart (ethpandaops#130)
* add web3signer helm chart Co-authored-by: Rafael Matias <[email protected]>
1 parent a2291ac commit ec30602

18 files changed

+918
-10
lines changed

README.md

+11-10
Original file line numberDiff line numberDiff line change
@@ -53,23 +53,24 @@ Consensus layer clients
5353
- [`teku`](charts/teku)
5454

5555
Tooling
56-
- [`beaconchain-explorer`](charts/beaconchain-explorer) - Beacon chain block explorer
57-
- [`blockscout`](charts/blockscout) - Execution layer block explorer
58-
- [`consensus-monitor`](charts/consensus-monitor) - Web UI to check your ethereum consensus layer nodes via their beacon APIs
59-
- [`dshackle`](charts/dshackle) - Fault tolerant load balancer for blockchain apis, including Ethereum RPC
60-
- [`eth2-fork-mon`](charts/eth2-fork-mon) - Fork monitor for a configurable set of beacon nodes
61-
- [`ethstats`](charts/ethstats) - Web UI to track execution layer node status
56+
- [`beaconchain-explorer`](charts/beaconchain-explorer) - Beacon chain block explorer.
57+
- [`blockscout`](charts/blockscout) - Execution layer block explorer.
58+
- [`consensus-monitor`](charts/consensus-monitor) - Web UI to check your ethereum consensus layer nodes via their beacon APIs.
59+
- [`dshackle`](charts/dshackle) - Fault tolerant load balancer for blockchain apis, including Ethereum RPC.
60+
- [`eth2-fork-mon`](charts/eth2-fork-mon) - Fork monitor for a configurable set of beacon nodes.
61+
- [`ethstats`](charts/ethstats) - Web UI to track execution layer node status.
6262
- [`fauceth`](charts/fauceth) - EIP1559 compatible web faucet using Hcaptcha.
63-
- [`forkmon`](charts/forkmon) - Fork monitor for execution layer nodes
64-
- [`ganache`](charts/ganache) - Simulator for development and testing purposes of the execution layer
65-
- [`genesis-generator`](charts/genesis-generator) - A tool to generate and expose genesis files for the execution and consensus layer clients
63+
- [`forkmon`](charts/forkmon) - Fork monitor for execution layer nodes.
64+
- [`ganache`](charts/ganache) - Simulator for development and testing purposes of the execution layer.
65+
- [`genesis-generator`](charts/genesis-generator) - A tool to generate and expose genesis files for the execution and consensus layer clients.
6666
- [`rpc-proxy`](charts/rpc-proxy) - A proxy for web3 JSONRPC. Rate limiting and method filtering.
67-
- [`testnet-faucet`](charts/testnet-faucet) - Web faucet that can be used to distribute testnet ETH to users
67+
- [`testnet-faucet`](charts/testnet-faucet) - Web faucet that can be used to distribute testnet ETH to users.
6868
- [`testnet-homepage`](charts/testnet-homepage) - Simple website that can be used to display useful information about your testnet.
6969
- [`ethereum-metrics-exporter`](charts/ethereum-metrics-exporter) - A prometheus exporter for Ethereum execution and consensus clients.
7070
- [`checkpointz`](charts/checkpointz) - A beacon chain Checkpoint Sync provider.
7171
- [`ethereum-address-metrics-exporter`](charts/ethereum-address-metrics-exporter) - A prometheus exporter for Ethereum externally owned account and contract addresses.
7272
- [`smart-contract-verifier-http`](charts/smart-contract-verifier-http) - Smart contract verification service.
73+
- [`web3signer`](charts/web3signer) - An open-source remote signing service.
7374

7475
## Development
7576

charts/web3signer/.helmignore

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/

charts/web3signer/Chart.lock

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
dependencies:
2+
- name: postgresql
3+
repository: https://charts.bitnami.com/bitnami
4+
version: 11.9.13
5+
digest: sha256:d0e9612833647ddb6d1d4a911f52a6609fe556aab7a757c1cf722a74accdb9fc
6+
generated: "2022-10-27T11:48:07.327750574+02:00"

charts/web3signer/Chart.yaml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apiVersion: v2
2+
name: web3signer
3+
description: Web3Signer is capable of signing on multiple platforms using private keys stored in an external vault, or encrypted on a disk.
4+
home: https://github.com/Consensys/web3signer/
5+
type: application
6+
version: 0.1.0
7+
maintainers:
8+
- name: barnabasbusa
9+
10+
- name: skylenet
11+
12+
dependencies:
13+
- name: postgresql
14+
version: "11.x.x"
15+
repository: "https://charts.bitnami.com/bitnami"
16+
condition: slashingprotectiondb.enabled
17+
alias: slashingprotectiondb

charts/web3signer/README.md

+123
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
2+
# web3signer
3+
4+
![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
5+
6+
Web3Signer is capable of signing on multiple platforms using private keys stored in an external vault, or encrypted on a disk.
7+
8+
**Homepage:** <https://github.com/Consensys/web3signer/>
9+
10+
## Requirements
11+
12+
| Repository | Name | Version |
13+
|------------|------|---------|
14+
| https://charts.bitnami.com/bitnami | slashingprotectiondb(postgresql) | 11.x.x |
15+
16+
## Values
17+
18+
| Key | Type | Default | Description |
19+
|-----|------|---------|-------------|
20+
| affinity | object | `{}` | Affinity configuration for pods |
21+
| annotations | object | `{}` | Annotations for the StatefulSet |
22+
| config | string | See `values.yaml` | Config file |
23+
| containerSecurityContext | object | See `values.yaml` | The security context for containers |
24+
| customCommand | list | `[]` | Command replacement for the web3signer container |
25+
| extraArgs | list | `[]` | Extra args for the web3signer container |
26+
| extraContainers | list | `[]` | Additional containers |
27+
| extraEnv | list | `[]` | Additional env variables |
28+
| extraPorts | list | `[]` | Additional ports. Useful when using extraContainers |
29+
| extraVolumeMounts | list | `[]` | Additional volume mounts |
30+
| extraVolumes | list | `[]` | Additional volumes |
31+
| fullnameOverride | string | `""` | Overrides the chart's computed fullname |
32+
| httpPort | int | `9000` | |
33+
| image.pullPolicy | string | `"IfNotPresent"` | web3signer container pull policy |
34+
| image.repository | string | `"consensys/web3signer"` | web3signer container image repository |
35+
| image.tag | string | `"22.10.0"` | web3signer container image tag |
36+
| imagePullSecrets | list | `[]` | Image pull secrets for Docker images |
37+
| ingress.annotations | object | `{}` | Annotations for Ingress |
38+
| ingress.enabled | bool | `false` | Ingress resource for the HTTP API |
39+
| ingress.hosts[0].host | string | `"chart-example.local"` | |
40+
| ingress.hosts[0].paths | list | `[]` | |
41+
| ingress.tls | list | `[]` | Ingress TLS |
42+
| initChownData.enabled | bool | `true` | Init container to set the correct permissions to access data directories |
43+
| initChownData.image.pullPolicy | string | `"IfNotPresent"` | Container pull policy |
44+
| initChownData.image.repository | string | `"busybox"` | Container repository |
45+
| initChownData.image.tag | string | `"1.34.1"` | Container tag |
46+
| initChownData.resources | object | `{}` | Resource requests and limits |
47+
| initContainers | list | `[]` | Additional init containers |
48+
| livenessProbe | object | See `values.yaml` | Liveness probe |
49+
| metricsPort | int | `9001` | |
50+
| nameOverride | string | `""` | Overrides the chart's name |
51+
| nodeSelector | object | `{}` | Node selector for pods |
52+
| persistence.accessModes | list | `["ReadWriteOnce"]` | Access mode for the volume claim template |
53+
| persistence.annotations | object | `{}` | Annotations for volume claim template |
54+
| persistence.enabled | bool | `true` | Uses an EmptyDir when not enabled |
55+
| persistence.existingClaim | string | `nil` | Use an existing PVC when persistence.enabled |
56+
| persistence.selector | object | `{}` | Selector for volume claim template |
57+
| persistence.size | string | `"1Gi"` | Requested size for volume claim template |
58+
| persistence.storageClassName | string | `nil` | Use a specific storage class E.g 'local-path' for local storage to achieve best performance Read more (https://github.com/rancher/local-path-provisioner) |
59+
| podAnnotations | object | `{}` | Pod annotations |
60+
| podDisruptionBudget | object | `{}` | Define the PodDisruptionBudget spec If not set then a PodDisruptionBudget will not be created |
61+
| podLabels | object | `{}` | Pod labels |
62+
| podManagementPolicy | string | `"OrderedReady"` | Pod management policy |
63+
| priorityClassName | string | `nil` | Pod priority class |
64+
| readinessProbe | object | See `values.yaml` | Readiness probe |
65+
| replicas | int | `1` | Number of replicas |
66+
| resources | object | `{}` | Resource requests and limits |
67+
| secretEnv | object | `{}` | Additional env variables injected via a created secret |
68+
| securityContext | object | See `values.yaml` | The security context for pods |
69+
| service.type | string | `"ClusterIP"` | Service type |
70+
| serviceAccount.annotations | object | `{}` | Annotations to add to the service account |
71+
| serviceAccount.create | bool | `true` | Specifies whether a service account should be created |
72+
| serviceAccount.name | string | `""` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template |
73+
| serviceMonitor.annotations | object | `{}` | Additional ServiceMonitor annotations |
74+
| serviceMonitor.enabled | bool | `false` | If true, a ServiceMonitor CRD is created for a prometheus operator https://github.com/coreos/prometheus-operator |
75+
| serviceMonitor.interval | string | `"1m"` | ServiceMonitor scrape interval |
76+
| serviceMonitor.labels | object | `{}` | Additional ServiceMonitor labels |
77+
| serviceMonitor.namespace | string | `nil` | Alternative namespace for ServiceMonitor |
78+
| serviceMonitor.path | string | `"/metrics"` | Path to scrape |
79+
| serviceMonitor.relabelings | list | `[]` | ServiceMonitor relabelings |
80+
| serviceMonitor.scheme | string | `"http"` | ServiceMonitor scheme |
81+
| serviceMonitor.scrapeTimeout | string | `"30s"` | ServiceMonitor scrape timeout |
82+
| serviceMonitor.tlsConfig | object | `{}` | ServiceMonitor TLS configuration |
83+
| slashingprotectiondb.auth.enablePostgresUser | bool | `true` | |
84+
| slashingprotectiondb.auth.postgresPassword | string | `"postgres"` | |
85+
| slashingprotectiondb.enabled | bool | `true` | If enabled a postgres chart will be deployed as a dependency to be used as a slashing protection database |
86+
| slashingprotectiondb.primary.extraVolumeMounts[0].mountPath | string | `"/sql-scripts"` | |
87+
| slashingprotectiondb.primary.extraVolumeMounts[0].name | string | `"sql-scripts"` | |
88+
| slashingprotectiondb.primary.extraVolumes[0].emptyDir | object | `{}` | |
89+
| slashingprotectiondb.primary.extraVolumes[0].name | string | `"sql-scripts"` | |
90+
| slashingprotectiondb.primary.initContainers[0].command[0] | string | `"bash"` | |
91+
| slashingprotectiondb.primary.initContainers[0].command[1] | string | `"-acex"` | |
92+
| slashingprotectiondb.primary.initContainers[0].command[2] | string | `"cd /sql-scripts; wget https://raw.githubusercontent.com/ConsenSys/web3signer/22.10.0/slashing-protection/src/main/resources/migrations/postgresql/V00001__initial.sql; wget https://raw.githubusercontent.com/ConsenSys/web3signer/22.10.0/slashing-protection/src/main/resources/migrations/postgresql/V00002__removeUniqueConstraints.sql; wget https://raw.githubusercontent.com/ConsenSys/web3signer/22.10.0/slashing-protection/src/main/resources/migrations/postgresql/V00003__addLowWatermark.sql; wget https://raw.githubusercontent.com/ConsenSys/web3signer/22.10.0/slashing-protection/src/main/resources/migrations/postgresql/V00004__addGenesisValidatorsRoot.sql; wget https://raw.githubusercontent.com/ConsenSys/web3signer/22.10.0/slashing-protection/src/main/resources/migrations/postgresql/V00005__xnor_source_target_low_watermark.sql; wget https://raw.githubusercontent.com/ConsenSys/web3signer/22.10.0/slashing-protection/src/main/resources/migrations/postgresql/V00006__signed_data_indexes.sql; wget https://raw.githubusercontent.com/ConsenSys/web3signer/22.10.0/slashing-protection/src/main/resources/migrations/postgresql/V00007__add_db_version.sql; wget https://raw.githubusercontent.com/ConsenSys/web3signer/22.10.0/slashing-protection/src/main/resources/migrations/postgresql/V00008__signed_data_unique_constraints.sql; wget https://raw.githubusercontent.com/ConsenSys/web3signer/22.10.0/slashing-protection/src/main/resources/migrations/postgresql/V00009__upsert_validators.sql; wget https://raw.githubusercontent.com/ConsenSys/web3signer/22.10.0/slashing-protection/src/main/resources/migrations/postgresql/V00010__validator_enabled_status.sql;\n"` | |
93+
| slashingprotectiondb.primary.initContainers[0].image | string | `"bash:latest"` | |
94+
| slashingprotectiondb.primary.initContainers[0].imagePullPolicy | string | `"IfNotPresent"` | |
95+
| slashingprotectiondb.primary.initContainers[0].name | string | `"init-sql-migration-scripts"` | |
96+
| slashingprotectiondb.primary.initContainers[0].securityContext.runAsNonRoot | bool | `false` | |
97+
| slashingprotectiondb.primary.initContainers[0].securityContext.runAsUser | int | `0` | |
98+
| slashingprotectiondb.primary.initContainers[0].volumeMounts[0].mountPath | string | `"/sql-scripts"` | |
99+
| slashingprotectiondb.primary.initContainers[0].volumeMounts[0].name | string | `"sql-scripts"` | |
100+
| slashingprotectiondb.primary.initdb.password | string | `"postgres"` | |
101+
| slashingprotectiondb.primary.initdb.scripts."init_00.sql" | string | `"CREATE DATABASE web3signer;\n"` | |
102+
| slashingprotectiondb.primary.initdb.scripts."init_02_db.sh" | string | `"#!/bin/sh\nexport PGPASSWORD=postgres\ncd /sql-scripts\nfor FILE in *.sql; do\n psql -U postgres -h 127.0.0.1 -d web3signer -f $FILE\ndone\n"` | |
103+
| slashingprotectiondb.primary.initdb.user | string | `"postgres"` | |
104+
| slashingprotectiondb.primary.name | string | `"web3signer"` | |
105+
| slashingprotectiondb.primary.persistence.enabled | bool | `true` | Uses an EmptyDir when not enabled |
106+
| slashingprotectiondb.primary.persistence.size | string | `"1Gi"` | |
107+
| terminationGracePeriodSeconds | int | `300` | How long to wait until the pod is forcefully terminated |
108+
| tolerations | list | `[]` | Tolerations for pods |
109+
| updateStrategy | object | `{"type":"RollingUpdate"}` | Update stategy for the Statefulset |
110+
| updateStrategy.type | string | `"RollingUpdate"` | Update stategy type |
111+
112+
# Examples
113+
114+
## Configure Slashing Protection Database
115+
116+
The chart supports a PostgreSQL Database that will be used for slashing protection by default.
117+
118+
```yaml
119+
slashingprotectiondb:
120+
enabled: true
121+
```
122+
123+
If you would like to disable this feature, you could disable it by setting `slashingprotectiondb.enable=false`. Only do this if you know what you're doing.

charts/web3signer/README.md.gotmpl

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
{{ template "chart.header" . }}
3+
{{ template "chart.deprecationWarning" . }}
4+
5+
{{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}
6+
7+
{{ template "chart.description" . }}
8+
9+
{{ template "chart.homepageLine" . }}
10+
11+
{{ template "chart.sourcesSection" . }}
12+
13+
{{ template "chart.requirementsSection" . }}
14+
15+
{{ template "chart.valuesSection" . }}
16+
17+
# Examples
18+
19+
## Configure Slashing Protection Database
20+
21+
The chart supports a PostgreSQL Database that will be used for slashing protection by default.
22+
23+
```yaml
24+
slashingprotectiondb:
25+
enabled: true
26+
```
27+
28+
If you would like to disable this feature, you could disable it by setting `slashingprotectiondb.enable=false`. Only do this if you know what you're doing.

charts/web3signer/ci/default-values.yaml

Whitespace-only changes.

charts/web3signer/templates/_cmd.tpl

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{{/*
2+
# Default command
3+
*/}}
4+
{{- define "web3signer.defaultCommand" -}}
5+
- sh
6+
- -ac
7+
- >
8+
/opt/web3signer/bin/web3signer
9+
--config-file=/data/config.yaml
10+
eth2
11+
{{- range .Values.extraArgs }}
12+
{{ . }}
13+
{{- end }}
14+
{{- end }}
+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "web3signer.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "web3signer.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "web3signer.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "web3signer.labels" -}}
37+
helm.sh/chart: {{ include "web3signer.chart" . }}
38+
{{ include "web3signer.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "web3signer.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "web3signer.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
52+
53+
{{/*
54+
Create the name of the service account to use
55+
*/}}
56+
{{- define "web3signer.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "web3signer.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: {{ include "web3signer.fullname" . }}
5+
labels:
6+
{{- include "web3signer.labels" . | nindent 4 }}
7+
data:
8+
config.yaml: |
9+
{{- tpl .Values.config . | nindent 4 }}
+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{{- if .Values.ingress.enabled -}}
2+
{{- $fullName := include "web3signer.fullname" . -}}
3+
{{- $svcPort := .Values.httpPort -}}
4+
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
5+
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
6+
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
7+
{{- end }}
8+
{{- end }}
9+
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
10+
apiVersion: networking.k8s.io/v1
11+
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
12+
apiVersion: networking.k8s.io/v1beta1
13+
{{- else -}}
14+
apiVersion: extensions/v1beta1
15+
{{- end }}
16+
kind: Ingress
17+
metadata:
18+
name: {{ $fullName }}
19+
labels:
20+
{{- include "web3signer.labels" . | nindent 4 }}
21+
{{- with .Values.ingress.annotations }}
22+
annotations:
23+
{{- toYaml . | nindent 4 }}
24+
{{- end }}
25+
spec:
26+
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
27+
ingressClassName: {{ .Values.ingress.className }}
28+
{{- end }}
29+
{{- if .Values.ingress.tls }}
30+
tls:
31+
{{- range .Values.ingress.tls }}
32+
- hosts:
33+
{{- range .hosts }}
34+
- {{ . | quote }}
35+
{{- end }}
36+
secretName: {{ .secretName }}
37+
{{- end }}
38+
{{- end }}
39+
rules:
40+
{{- range .Values.ingress.hosts }}
41+
- host: {{ .host | quote }}
42+
http:
43+
paths:
44+
{{- range .paths }}
45+
- path: {{ .path }}
46+
{{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
47+
pathType: {{ .pathType }}
48+
{{- end }}
49+
backend:
50+
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
51+
service:
52+
name: {{ $fullName }}
53+
port:
54+
number: {{ $svcPort }}
55+
{{- else }}
56+
serviceName: {{ $fullName }}
57+
servicePort: {{ $svcPort }}
58+
{{- end }}
59+
{{- end }}
60+
{{- end }}
61+
{{- end }}

0 commit comments

Comments
 (0)