Skip to content

Commit 3ac07b4

Browse files
authored
feat: add support of multiplexer in Helm chart (#221)
1 parent 895aa20 commit 3ac07b4

File tree

7 files changed

+214
-38
lines changed

7 files changed

+214
-38
lines changed

provisioning/k8s/commit-boost/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ apiVersion: v2
22
name: commit-boost
33
description: A Helm chart for Kubernetes
44
type: application
5-
version: 0.0.4
6-
appVersion: "v0.2.0"
5+
version: 0.0.5
6+
appVersion: "v0.4.0"
77
maintainers:
88
- name: mxs
99

provisioning/k8s/commit-boost/README.md

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# commit-boost
22

3-
![Version: 0.0.4](https://img.shields.io/badge/Version-0.0.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.2.0](https://img.shields.io/badge/AppVersion-v0.2.0-informational?style=flat-square)
3+
![Version: 0.0.5](https://img.shields.io/badge/Version-0.0.5-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.4.0](https://img.shields.io/badge/AppVersion-v0.4.0-informational?style=flat-square)
44

55
A Helm chart for Kubernetes
66

77
## Maintainers
88

99
| Name | Email | Url |
1010
| ---- | ------ | --- |
11-
| mxs | [email protected] | |
11+
| mxs | <[email protected]> | |
1212

1313
## Values
1414

@@ -19,12 +19,17 @@ A Helm chart for Kubernetes
1919
| autoscaling.maxReplicas | int | `100` | |
2020
| autoscaling.minReplicas | int | `1` | |
2121
| autoscaling.targetCPUUtilizationPercentage | int | `80` | |
22-
| commitBoost.pbs.config | string | `"chain = \"Holesky\"\n\n[pbs]\nport = 18550\n\n[[relays]]\nurl = \"https://0xafa4c6985aa049fb79dd37010438cfebeb0f2bd42b115b89dd678dab0670c1de38da0c4e9138c9290a398ecd9a0b3110@boost-relay-holesky.flashbots.net\""` | |
22+
| commitBoost.pbs.config.chain | string | `"Holesky"` | |
23+
| commitBoost.pbs.config.metrics.prometheus_config | string | `"/dev/null"` | |
24+
| commitBoost.pbs.config.metrics.server_port | int | `10000` | |
25+
| commitBoost.pbs.config.mux | list | `[]` | |
26+
| commitBoost.pbs.config.pbs.port | int | `18550` | |
27+
| commitBoost.pbs.config.relays | list | `[]` | |
2328
| commitBoost.pbs.enable | bool | `true` | |
29+
| commitBoost.pbs.image.pullPolicy | string | `"IfNotPresent"` | |
30+
| commitBoost.pbs.image.repository | string | `"ghcr.io/commit-boost/pbs"` | |
31+
| commitBoost.pbs.image.tag | string | `"v0.4.0"` | |
2432
| fullnameOverride | string | `""` | |
25-
| image.pullPolicy | string | `"IfNotPresent"` | |
26-
| image.repository | string | `"ghcr.io/commit-boost/pbs"` | |
27-
| image.tag | string | `"v0.2.0"` | |
2833
| imagePullSecrets | list | `[]` | |
2934
| ingress.annotations | object | `{}` | |
3035
| ingress.className | string | `""` | |
@@ -41,20 +46,24 @@ A Helm chart for Kubernetes
4146
| replicaCount | int | `1` | |
4247
| resources | object | `{}` | |
4348
| securityContext | object | `{}` | |
44-
| service.metrics_port | int | `10000` | |
45-
| service.port | int | `18550` | |
49+
| service.pbs_metrics_port | int | `10000` | |
50+
| service.pbs_port | int | `18550` | |
4651
| service.type | string | `"ClusterIP"` | |
4752
| serviceAccount.annotations | object | `{}` | |
4853
| serviceAccount.automount | bool | `true` | |
4954
| serviceAccount.create | bool | `true` | |
5055
| serviceAccount.name | string | `""` | |
56+
| serviceMonitor.additionalLabels | object | `{}` | |
5157
| serviceMonitor.enabled | bool | `true` | |
52-
| serviceMonitor.honorLabels | bool | `true` | |
58+
| serviceMonitor.metricRelabelings | list | `[]` | |
59+
| serviceMonitor.namespace | string | `""` | |
60+
| serviceMonitor.namespaceSelector | object | `{}` | |
5361
| serviceMonitor.path | string | `"/metrics"` | |
5462
| serviceMonitor.scrapeInterval | string | `"30s"` | |
63+
| serviceMonitor.targetLabels | list | `[]` | |
5564
| tolerations | list | `[]` | |
5665
| volumeMounts | list | `[]` | |
5766
| volumes | list | `[]` | |
5867

5968
----------------------------------------------
60-
Autogenerated from chart metadata using [helm-docs v1.7.0](https://github.com/norwoodj/helm-docs/releases/v1.7.0)
69+
Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)

provisioning/k8s/commit-boost/templates/configmap.yaml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,23 @@ metadata:
66
{{- include "commit-boost.labels" . | nindent 4 }}
77
data:
88
{{- if .Values.commitBoost.pbs.enable }}
9+
# Currently toToml doesn't handle properly integer conversions, it
10+
# translates them to floats with a trailing ".0" leading to commit-boost
11+
# crashing at start. We have three possible approaches to fix this:
12+
#
13+
# 1. Do not use toToml and manually convert all config fields from yaml to
14+
# toml, this means the chart won't be in sync with evolutions of
15+
# commit-boost,
16+
#
17+
# 2. Have commit-boost handle floats as integers in the config parsing, this
18+
# would likely be confusing for everyone else using commit-boost,
19+
#
20+
# 3. Introduce a temporary hack to remove trailing .0 from the toml output. This
21+
# is the current temporary approach taken. It's dangerous because it might
22+
# remove ".0" from other places where it's actually needed.
23+
#
24+
# We use 3) for now considering https://github.com/helm/helm/pull/13534 is likely
25+
# to be part of a new Helm version.
926
config.pbs.toml: |-
10-
{{ .Values.commitBoost.pbs.config | nindent 4 }}
27+
{{ .Values.commitBoost.pbs.config | toToml | replace ".0" "" | nindent 4 }}
1128
{{- end }}

provisioning/k8s/commit-boost/templates/deployment.yaml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ spec:
3535
- name: {{ .Chart.Name }}-pbs
3636
securityContext:
3737
{{- toYaml .Values.securityContext | nindent 12 }}
38-
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
39-
imagePullPolicy: {{ .Values.image.pullPolicy }}
38+
image: "{{ .Values.commitBoost.pbs.image.repository }}:{{ .Values.commitBoost.pbs.image.tag }}"
39+
imagePullPolicy: {{ .Values.commitBoost.pbs.image.pullPolicy }}
4040
ports:
4141
- name: http-pbs
42-
containerPort: {{ .Values.service.port }}
42+
containerPort: {{ .Values.commitBoost.pbs.config.pbs.port }}
4343
protocol: TCP
4444
- name: http-metrics
45-
containerPort: {{ .Values.service.metrics_port }}
45+
containerPort: {{ .Values.commitBoost.pbs.config.metrics.server_port }}
4646
protocol: TCP
4747
livenessProbe:
4848
httpGet:
@@ -58,9 +58,13 @@ spec:
5858
- name: CB_CONFIG
5959
value: /config/config.pbs.toml
6060
- name: CB_METRICS_PORT
61-
value: '{{ .Values.service.metrics_port }}'
61+
value: "{{ .Values.commitBoost.pbs.config.metrics.server_port }}"
62+
- name: ROLLING_DURATION
63+
value: never
6264
- name: RUST_LOG
6365
value: info
66+
- name: CB_PBS_ENDPOINT
67+
value: "0.0.0.0:{{ .Values.commitBoost.pbs.config.pbs.port }}"
6468
volumeMounts:
6569
- name: commit-boost-configs
6670
mountPath: /config
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
1+
{{- if .Values.commitBoost.pbs.enable }}
12
apiVersion: v1
23
kind: Service
34
metadata:
45
name: {{ include "commit-boost.fullname" . }}
56
labels:
67
{{- include "commit-boost.labels" . | nindent 4 }}
78
spec:
8-
type: {{ .Values.service.type }}
9+
type: ClusterIP
910
ports:
10-
- port: {{ .Values.service.port }}
11+
- port: {{ .Values.commitBoost.pbs.config.pbs.port}}
1112
name: http-pbs
1213
targetPort: http-pbs
1314
protocol: TCP
14-
- port: {{ .Values.service.metrics_port }}
15+
- port: {{ .Values.commitBoost.pbs.config.metrics.server_port}}
1516
protocol: TCP
1617
name: http-metrics
1718
targetPort: http-metrics
1819
selector:
1920
{{- include "commit-boost.selectorLabels" . | nindent 4 }}
21+
{{- end }}
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
# Default values for commit-boost.
2+
# This is a YAML-formatted file.
3+
# Declare variables to be passed into your templates.
4+
5+
replicaCount: 1
6+
7+
imagePullSecrets: []
8+
nameOverride: ""
9+
fullnameOverride: ""
10+
11+
serviceAccount:
12+
# Specifies whether a service account should be created
13+
create: true
14+
# Automatically mount a ServiceAccount's API credentials?
15+
automount: true
16+
# Annotations to add to the service account
17+
annotations: {}
18+
# The name of the service account to use.
19+
# If not set and create is true, a name is generated using the fullname template
20+
name: ""
21+
22+
podAnnotations: {}
23+
podLabels: {}
24+
25+
podSecurityContext:
26+
{}
27+
# fsGroup: 2000
28+
29+
securityContext:
30+
{}
31+
# capabilities:
32+
# drop:
33+
# - ALL
34+
# readOnlyRootFilesystem: true
35+
# runAsNonRoot: true
36+
# runAsUser: 1000
37+
38+
service:
39+
type: ClusterIP
40+
pbs_port: 18550
41+
pbs_metrics_port: 10000
42+
43+
ingress:
44+
enabled: false
45+
className: ""
46+
annotations:
47+
{}
48+
# kubernetes.io/ingress.class: nginx
49+
# kubernetes.io/tls-acme: "true"
50+
hosts:
51+
- host: chart-example.local
52+
paths:
53+
- path: /
54+
pathType: ImplementationSpecific
55+
tls: []
56+
# - secretName: chart-example-tls
57+
# hosts:
58+
# - chart-example.local
59+
60+
resources:
61+
{}
62+
# We usually recommend not to specify default resources and to leave this as a conscious
63+
# choice for the user. This also increases chances charts run on environments with little
64+
# resources, such as Minikube. If you do want to specify resources, uncomment the following
65+
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
66+
# limits:
67+
# cpu: 100m
68+
# memory: 128Mi
69+
# requests:
70+
# cpu: 100m
71+
# memory: 128Mi
72+
73+
autoscaling:
74+
enabled: false
75+
minReplicas: 1
76+
maxReplicas: 100
77+
targetCPUUtilizationPercentage: 80
78+
# targetMemoryUtilizationPercentage: 80
79+
80+
# Additional volumes on the output Deployment definition.
81+
volumes: []
82+
# - name: foo
83+
# secret:
84+
# secretName: mysecret
85+
# optional: false
86+
87+
# Additional volumeMounts on the output Deployment definition.
88+
volumeMounts: []
89+
# - name: foo
90+
# mountPath: "/etc/foo"
91+
# readOnly: true
92+
93+
nodeSelector: {}
94+
95+
tolerations: []
96+
97+
affinity: {}
98+
99+
serviceMonitor:
100+
enabled: true
101+
additionalLabels: {}
102+
namespace: ""
103+
namespaceSelector: {}
104+
scrapeInterval: 30s
105+
targetLabels: []
106+
metricRelabelings: []
107+
path: /metrics
108+
109+
commitBoost:
110+
pbs:
111+
enable: true
112+
image:
113+
repository: ghcr.io/commit-boost/pbs
114+
pullPolicy: IfNotPresent
115+
tag: "v0.4.0"
116+
config:
117+
chain: "Holesky"
118+
metrics:
119+
server_port: 10000
120+
prometheus_config: "/dev/null"
121+
pbs:
122+
port: 18550
123+
timeout_get_header_ms: 900
124+
late_in_slot_time_ms: 1000
125+
relays:
126+
- id: "flashbot"
127+
url: "https://0xafa4c6985aa049fb79dd37010438cfebeb0f2bd42b115b89dd678dab0670c1de38da0c4e9138c9290a398ecd9a0b3110@boost-relay-holesky.flashbots.net"
128+
enable_timing_games: false
129+
target_first_request_ms: 500
130+
frequency_get_header_ms: 100
131+
mux:
132+
- id: "timing-games"
133+
timeout_get_header_ms: 900
134+
late_in_slot_time_ms: 1000
135+
validator_pubkeys: ["0x80c7f782b2467c5898c5516a8b6595d75623960b4afc4f71ee07d40985d20e117ba35e7cd352a3e75fb85a8668a3b745"]
136+
relays:
137+
- id: "flashbot"
138+
url: "https://0xafa4c6985aa049fb79dd37010438cfebeb0f2bd42b115b89dd678dab0670c1de38da0c4e9138c9290a398ecd9a0b3110@boost-relay-holesky.flashbots.net"
139+
enable_timing_games: true
140+
target_first_request_ms: 500
141+
frequency_get_header_ms: 100

provisioning/k8s/commit-boost/values.yaml

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@
44

55
replicaCount: 1
66

7-
image:
8-
repository: ghcr.io/commit-boost/pbs
9-
pullPolicy: IfNotPresent
10-
tag: "v0.2.0"
11-
127
imagePullSecrets: []
138
nameOverride: ""
149
fullnameOverride: ""
@@ -42,8 +37,8 @@ securityContext:
4237

4338
service:
4439
type: ClusterIP
45-
port: 18550
46-
metrics_port: 10000
40+
pbs_port: 18550
41+
pbs_metrics_port: 10000
4742

4843
ingress:
4944
enabled: false
@@ -103,19 +98,27 @@ affinity: {}
10398

10499
serviceMonitor:
105100
enabled: true
101+
additionalLabels: {}
102+
namespace: ""
103+
namespaceSelector: {}
106104
scrapeInterval: 30s
105+
targetLabels: []
106+
metricRelabelings: []
107107
path: /metrics
108-
honorLabels: true
109-
110108

111109
commitBoost:
112110
pbs:
113111
enable: true
114-
config: |-
115-
chain = "Holesky"
116-
117-
[pbs]
118-
port = 18550
119-
120-
[[relays]]
121-
url = "https://0xafa4c6985aa049fb79dd37010438cfebeb0f2bd42b115b89dd678dab0670c1de38da0c4e9138c9290a398ecd9a0b3110@boost-relay-holesky.flashbots.net"
112+
image:
113+
repository: ghcr.io/commit-boost/pbs
114+
pullPolicy: IfNotPresent
115+
tag: "v0.4.0"
116+
config:
117+
chain: "Holesky"
118+
metrics:
119+
server_port: 10000
120+
prometheus_config: "/dev/null"
121+
pbs:
122+
port: 18550
123+
relays: []
124+
mux: []

0 commit comments

Comments
 (0)