Skip to content

Commit 7133c30

Browse files
authored
feat(charts/stubbies): init (ethpandaops#148)
1 parent ab5849f commit 7133c30

15 files changed

+666
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ Tooling
7575
- [`checkpointz`](charts/checkpointz) - A beacon chain Checkpoint Sync provider.
7676
- [`ethereum-address-metrics-exporter`](charts/ethereum-address-metrics-exporter) - A prometheus exporter for Ethereum externally owned account and contract addresses.
7777
- [`smart-contract-verifier-http`](charts/smart-contract-verifier-http) - Smart contract verification service.
78+
- [`stubbies`](charts/stubbies) - Ethereum execution client stub for consensus layer clients.
7879
- [`web3signer`](charts/web3signer) - An open-source remote signing service.
7980
- [`xatu-sentry`](charts/xatu-sentry) - Ethereum p2p monitoring tool that runs along side a [Ethereum consensus client](https://ethereum.org/en/developers/docs/nodes-and-clients/#consensus-clients) and collects data via the consensus client's [Beacon API](https://ethereum.github.io/beacon-APIs/).
8081
- [`xatu-server`](charts/xatu-server) - Ethereum p2p monitoring tool that collects events from and controls various Xatu clients.

charts/stubbies/.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/stubbies/Chart.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: v2
2+
name: stubbies
3+
description: Ethereum execution client stub for consensus layer clients.
4+
home: https://github.com/ethpandaops/stubbies
5+
type: application
6+
version: 0.0.1
7+
maintainers:
8+
- name: savid
9+

charts/stubbies/README.md

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
2+
# stubbies
3+
4+
![Version: 0.0.1](https://img.shields.io/badge/Version-0.0.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
5+
6+
Ethereum execution client stub for consensus layer clients.
7+
8+
**Homepage:** <https://github.com/ethpandaops/stubbies>
9+
10+
## Values
11+
12+
| Key | Type | Default | Description |
13+
|-----|------|---------|-------------|
14+
| affinity | object | `{}` | Affinity configuration for pods |
15+
| annotations | object | `{}` | Annotations for the Deployment |
16+
| args | list | `[]` | Command arguments |
17+
| config.addr | string | `":8551"` | |
18+
| config.logging | string | `"info"` | |
19+
| config.metricsAddr | string | `":9090"` | |
20+
| containerSecurityContext | object | See `values.yaml` | The security context for containers |
21+
| customArgs | list | `[]` | Custom args for the stubbies container |
22+
| customCommand | list | `[]` | Command replacement for the stubbies container |
23+
| extraContainers | list | `[]` | Additional containers |
24+
| extraEnv | list | `[]` | Additional env variables |
25+
| extraPodPorts | list | `[]` | Extra Pod ports |
26+
| extraPorts | list | `[]` | Additional ports. Useful when using extraContainers |
27+
| extraVolumeMounts | list | `[]` | Additional volume mounts |
28+
| extraVolumes | list | `[]` | Additional volumes |
29+
| fullnameOverride | string | `""` | Overrides the chart's computed fullname |
30+
| image.pullPolicy | string | `"IfNotPresent"` | stubbies container pull policy |
31+
| image.repository | string | `"ethpandaops/stubbies"` | stubbies container image repository |
32+
| image.tag | string | `"latest"` | stubbies container image tag |
33+
| imagePullSecrets | list | `[]` | Image pull secrets for Docker images |
34+
| ingress.annotations | object | `{}` | Annotations for Ingress |
35+
| ingress.enabled | bool | `false` | Ingress resource for the HTTP API |
36+
| ingress.hosts[0].host | string | `"chart-example.local"` | |
37+
| ingress.hosts[0].paths | list | `[]` | |
38+
| ingress.tls | list | `[]` | Ingress TLS |
39+
| initContainers | list | `[]` | Additional init containers |
40+
| livenessProbe | object | See `values.yaml` | Liveness probe |
41+
| nameOverride | string | `""` | Overrides the chart's name |
42+
| nodeSelector | object | `{}` | Node selector for pods |
43+
| podAnnotations | object | `{}` | Pod annotations |
44+
| podDisruptionBudget | object | `{}` | Define the PodDisruptionBudget spec If not set then a PodDisruptionBudget will not be created |
45+
| podLabels | object | `{}` | Pod labels |
46+
| priorityClassName | string | `nil` | Pod priority class |
47+
| readinessProbe | object | See `values.yaml` | Readiness probe |
48+
| replicas | int | `1` | Number of replicas |
49+
| resources | object | `{}` | Resource requests and limits |
50+
| secretEnv | object | `{}` | Secret env variables injected via a created secret |
51+
| securityContext | object | See `values.yaml` | The security context for pods |
52+
| service.type | string | `"ClusterIP"` | Service type |
53+
| serviceAccount.annotations | object | `{}` | Annotations to add to the service account |
54+
| serviceAccount.create | bool | `false` | Specifies whether a service account should be created |
55+
| 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 |
56+
| serviceMonitor.annotations | object | `{}` | Additional ServiceMonitor annotations |
57+
| serviceMonitor.enabled | bool | `false` | If true, a ServiceMonitor CRD is created for a prometheus operator https://github.com/coreos/prometheus-operator |
58+
| serviceMonitor.interval | string | `"15s"` | ServiceMonitor scrape interval |
59+
| serviceMonitor.labels | object | `{}` | Additional ServiceMonitor labels |
60+
| serviceMonitor.namespace | string | `nil` | Alternative namespace for ServiceMonitor |
61+
| serviceMonitor.path | string | `"/metrics"` | Path to scrape |
62+
| serviceMonitor.relabelings | list | `[]` | ServiceMonitor relabelings |
63+
| serviceMonitor.scheme | string | `"http"` | ServiceMonitor scheme |
64+
| serviceMonitor.scrapeTimeout | string | `"30s"` | ServiceMonitor scrape timeout |
65+
| serviceMonitor.tlsConfig | object | `{}` | ServiceMonitor TLS configuration |
66+
| terminationGracePeriodSeconds | int | `30` | How long to wait until the pod is forcefully terminated |
67+
| tolerations | list | `[]` | Tolerations for pods |

charts/stubbies/README.md.gotmpl

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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" . }}

charts/stubbies/templates/NOTES.txt

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
1. Get the application URL by running these commands:
2+
{{- if .Values.ingress.enabled }}
3+
{{- range $host := .Values.ingress.hosts }}
4+
{{- range .paths }}
5+
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
6+
{{- end }}
7+
{{- end }}
8+
{{- else if contains "NodePort" .Values.service.type }}
9+
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "stubbies.fullname" . }})
10+
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
11+
echo http://$NODE_IP:$NODE_PORT
12+
{{- else if contains "LoadBalancer" .Values.service.type }}
13+
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
14+
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "stubbies.fullname" . }}'
15+
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "stubbies.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
16+
echo http://$SERVICE_IP:{{ include "stubbies.httpPort" . }}
17+
{{- else if contains "ClusterIP" .Values.service.type }}
18+
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "stubbies.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
19+
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
20+
echo "Visit http://127.0.0.1:8080 to use your application"
21+
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
22+
{{- end }}
+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "stubbies.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 "stubbies.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 "stubbies.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "stubbies.labels" -}}
37+
helm.sh/chart: {{ include "stubbies.chart" . }}
38+
{{ include "stubbies.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 "stubbies.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "stubbies.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 "stubbies.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "stubbies.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}
63+
64+
{{- define "stubbies.httpPort" -}}
65+
{{ (split ":" .Values.config.addr)._1 | default ":8080" }}
66+
{{- end }}
67+
68+
{{- define "stubbies.metricsPort" -}}
69+
{{ (split ":" .Values.config.metricsAddr)._1 | default ":9090" }}
70+
{{- end -}}
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: {{ include "stubbies.fullname" . }}
5+
labels:
6+
{{- include "stubbies.labels" . | nindent 4 }}
7+
data:
8+
config.yaml: |-
9+
{{ toYaml .Values.config | nindent 4 }}
+114
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ include "stubbies.fullname" . }}
5+
labels:
6+
{{- include "stubbies.labels" . | nindent 4 }}
7+
annotations:
8+
{{- toYaml .Values.annotations | nindent 4 }}
9+
spec:
10+
replicas: {{ .Values.replicas }}
11+
selector:
12+
matchLabels:
13+
{{- include "stubbies.selectorLabels" . | nindent 6 }}
14+
template:
15+
metadata:
16+
labels:
17+
{{- include "stubbies.selectorLabels" . | nindent 8 }}
18+
{{- with .Values.podLabels }}
19+
{{- toYaml . | nindent 8 }}
20+
{{- end }}
21+
annotations:
22+
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
23+
checksum/secrets: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
24+
{{- with .Values.podAnnotations }}
25+
{{- toYaml . | nindent 8 }}
26+
{{- end }}
27+
spec:
28+
serviceAccountName: {{ include "stubbies.serviceAccountName" . }}
29+
{{- if .Values.priorityClassName }}
30+
priorityClassName: {{ .Values.priorityClassName }}
31+
{{- end }}
32+
securityContext:
33+
{{- toYaml .Values.securityContext | nindent 8 }}
34+
initContainers:
35+
{{- if .Values.initContainers }}
36+
{{- toYaml .Values.initContainers | nindent 8 }}
37+
{{- end }}
38+
{{- with .Values.imagePullSecrets }}
39+
imagePullSecrets:
40+
{{- toYaml . | nindent 8 }}
41+
{{- end }}
42+
containers:
43+
- name: {{ .Chart.Name }}
44+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
45+
imagePullPolicy: {{ .Values.image.pullPolicy }}
46+
command:
47+
{{- if gt (len .Values.customCommand) 0 }}
48+
{{- toYaml .Values.customCommand | nindent 12}}
49+
{{- else }}
50+
- "/stubbies"
51+
- "server"
52+
- --config=/config.yaml
53+
{{- if gt (len .Values.args) 0 }}
54+
{{- toYaml .Values.args | nindent 12}}
55+
{{- end }}
56+
{{- end }}
57+
{{- if gt (len .Values.customArgs) 0 }}
58+
args:
59+
{{- toYaml .Values.customArgs | nindent 12}}
60+
{{- end }}
61+
securityContext:
62+
{{- toYaml .Values.containerSecurityContext | nindent 12 }}
63+
volumeMounts:
64+
- name: config
65+
mountPath: "/config.yaml"
66+
subPath: config.yaml
67+
readOnly: true
68+
{{- if .Values.extraVolumeMounts }}
69+
{{ toYaml .Values.extraVolumeMounts | nindent 12 }}
70+
{{- end }}
71+
ports:
72+
- name: http
73+
containerPort: {{ include "stubbies.httpPort" . }}
74+
protocol: TCP
75+
- name: metrics
76+
containerPort: {{ include "stubbies.metricsPort" . }}
77+
protocol: TCP
78+
{{- if .Values.extraPodPorts }}
79+
{{ toYaml .Values.extraPodPorts | nindent 10 }}
80+
{{- end }}
81+
livenessProbe:
82+
{{- toYaml .Values.livenessProbe | nindent 12 }}
83+
readinessProbe:
84+
{{- toYaml .Values.readinessProbe | nindent 12 }}
85+
resources:
86+
{{- toYaml .Values.resources | nindent 12 }}
87+
env:
88+
{{- range $key, $value := .Values.secretEnv }}
89+
- name: {{ $key }}
90+
valueFrom:
91+
secretKeyRef:
92+
name: {{ include "stubbies.fullname" $ }}-env
93+
key: {{ $key }}
94+
{{- end }}
95+
{{- if .Values.extraEnv }}
96+
{{- toYaml .Values.extraEnv | nindent 12 }}
97+
{{- end }}
98+
{{- if .Values.extraContainers }}
99+
{{ toYaml .Values.extraContainers | nindent 8}}
100+
{{- end }}
101+
nodeSelector:
102+
{{- toYaml .Values.nodeSelector | nindent 8 }}
103+
affinity:
104+
{{- toYaml .Values.affinity | nindent 8 }}
105+
tolerations:
106+
{{- toYaml .Values.tolerations | nindent 8 }}
107+
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
108+
volumes:
109+
{{- if .Values.extraVolumes }}
110+
{{ toYaml .Values.extraVolumes | nindent 8}}
111+
{{- end }}
112+
- name: config
113+
configMap:
114+
name: {{ include "stubbies.fullname" . }}

0 commit comments

Comments
 (0)