diff --git a/provisioning/k8s/commit-boost/Chart.yaml b/provisioning/k8s/commit-boost/Chart.yaml index d983f273..f6241fdb 100644 --- a/provisioning/k8s/commit-boost/Chart.yaml +++ b/provisioning/k8s/commit-boost/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: commit-boost description: A Helm chart for Kubernetes type: application -version: 0.0.4 -appVersion: "v0.2.0" +version: 0.0.5 +appVersion: "v0.4.0" maintainers: - name: mxs email: mxs@kiln.fi diff --git a/provisioning/k8s/commit-boost/README.md b/provisioning/k8s/commit-boost/README.md index b25ef318..af727f7e 100644 --- a/provisioning/k8s/commit-boost/README.md +++ b/provisioning/k8s/commit-boost/README.md @@ -1,6 +1,6 @@ # commit-boost -![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) +![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) A Helm chart for Kubernetes @@ -8,7 +8,7 @@ A Helm chart for Kubernetes | Name | Email | Url | | ---- | ------ | --- | -| mxs | mxs@kiln.fi | | +| mxs | | | ## Values @@ -19,12 +19,17 @@ A Helm chart for Kubernetes | autoscaling.maxReplicas | int | `100` | | | autoscaling.minReplicas | int | `1` | | | autoscaling.targetCPUUtilizationPercentage | int | `80` | | -| commitBoost.pbs.config | string | `"chain = \"Holesky\"\n\n[pbs]\nport = 18550\n\n[[relays]]\nurl = \"https://0xafa4c6985aa049fb79dd37010438cfebeb0f2bd42b115b89dd678dab0670c1de38da0c4e9138c9290a398ecd9a0b3110@boost-relay-holesky.flashbots.net\""` | | +| commitBoost.pbs.config.chain | string | `"Holesky"` | | +| commitBoost.pbs.config.metrics.prometheus_config | string | `"/dev/null"` | | +| commitBoost.pbs.config.metrics.server_port | int | `10000` | | +| commitBoost.pbs.config.mux | list | `[]` | | +| commitBoost.pbs.config.pbs.port | int | `18550` | | +| commitBoost.pbs.config.relays | list | `[]` | | | commitBoost.pbs.enable | bool | `true` | | +| commitBoost.pbs.image.pullPolicy | string | `"IfNotPresent"` | | +| commitBoost.pbs.image.repository | string | `"ghcr.io/commit-boost/pbs"` | | +| commitBoost.pbs.image.tag | string | `"v0.4.0"` | | | fullnameOverride | string | `""` | | -| image.pullPolicy | string | `"IfNotPresent"` | | -| image.repository | string | `"ghcr.io/commit-boost/pbs"` | | -| image.tag | string | `"v0.2.0"` | | | imagePullSecrets | list | `[]` | | | ingress.annotations | object | `{}` | | | ingress.className | string | `""` | | @@ -41,20 +46,24 @@ A Helm chart for Kubernetes | replicaCount | int | `1` | | | resources | object | `{}` | | | securityContext | object | `{}` | | -| service.metrics_port | int | `10000` | | -| service.port | int | `18550` | | +| service.pbs_metrics_port | int | `10000` | | +| service.pbs_port | int | `18550` | | | service.type | string | `"ClusterIP"` | | | serviceAccount.annotations | object | `{}` | | | serviceAccount.automount | bool | `true` | | | serviceAccount.create | bool | `true` | | | serviceAccount.name | string | `""` | | +| serviceMonitor.additionalLabels | object | `{}` | | | serviceMonitor.enabled | bool | `true` | | -| serviceMonitor.honorLabels | bool | `true` | | +| serviceMonitor.metricRelabelings | list | `[]` | | +| serviceMonitor.namespace | string | `""` | | +| serviceMonitor.namespaceSelector | object | `{}` | | | serviceMonitor.path | string | `"/metrics"` | | | serviceMonitor.scrapeInterval | string | `"30s"` | | +| serviceMonitor.targetLabels | list | `[]` | | | tolerations | list | `[]` | | | volumeMounts | list | `[]` | | | volumes | list | `[]` | | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.7.0](https://github.com/norwoodj/helm-docs/releases/v1.7.0) +Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0) diff --git a/provisioning/k8s/commit-boost/templates/configmap.yaml b/provisioning/k8s/commit-boost/templates/configmap.yaml index 6b5edb90..06aafa3d 100644 --- a/provisioning/k8s/commit-boost/templates/configmap.yaml +++ b/provisioning/k8s/commit-boost/templates/configmap.yaml @@ -6,6 +6,23 @@ metadata: {{- include "commit-boost.labels" . | nindent 4 }} data: {{- if .Values.commitBoost.pbs.enable }} + # Currently toToml doesn't handle properly integer conversions, it + # translates them to floats with a trailing ".0" leading to commit-boost + # crashing at start. We have three possible approaches to fix this: + # + # 1. Do not use toToml and manually convert all config fields from yaml to + # toml, this means the chart won't be in sync with evolutions of + # commit-boost, + # + # 2. Have commit-boost handle floats as integers in the config parsing, this + # would likely be confusing for everyone else using commit-boost, + # + # 3. Introduce a temporary hack to remove trailing .0 from the toml output. This + # is the current temporary approach taken. It's dangerous because it might + # remove ".0" from other places where it's actually needed. + # + # We use 3) for now considering https://github.com/helm/helm/pull/13534 is likely + # to be part of a new Helm version. config.pbs.toml: |- - {{ .Values.commitBoost.pbs.config | nindent 4 }} + {{ .Values.commitBoost.pbs.config | toToml | replace ".0" "" | nindent 4 }} {{- end }} diff --git a/provisioning/k8s/commit-boost/templates/deployment.yaml b/provisioning/k8s/commit-boost/templates/deployment.yaml index ed3eab9d..7f2de29a 100644 --- a/provisioning/k8s/commit-boost/templates/deployment.yaml +++ b/provisioning/k8s/commit-boost/templates/deployment.yaml @@ -35,14 +35,14 @@ spec: - name: {{ .Chart.Name }}-pbs securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} + image: "{{ .Values.commitBoost.pbs.image.repository }}:{{ .Values.commitBoost.pbs.image.tag }}" + imagePullPolicy: {{ .Values.commitBoost.pbs.image.pullPolicy }} ports: - name: http-pbs - containerPort: {{ .Values.service.port }} + containerPort: {{ .Values.commitBoost.pbs.config.pbs.port }} protocol: TCP - name: http-metrics - containerPort: {{ .Values.service.metrics_port }} + containerPort: {{ .Values.commitBoost.pbs.config.metrics.server_port }} protocol: TCP livenessProbe: httpGet: @@ -58,9 +58,13 @@ spec: - name: CB_CONFIG value: /config/config.pbs.toml - name: CB_METRICS_PORT - value: '{{ .Values.service.metrics_port }}' + value: "{{ .Values.commitBoost.pbs.config.metrics.server_port }}" + - name: ROLLING_DURATION + value: never - name: RUST_LOG value: info + - name: CB_PBS_ENDPOINT + value: "0.0.0.0:{{ .Values.commitBoost.pbs.config.pbs.port }}" volumeMounts: - name: commit-boost-configs mountPath: /config diff --git a/provisioning/k8s/commit-boost/templates/service.yaml b/provisioning/k8s/commit-boost/templates/service.yaml index b00de6b5..5dee6ab5 100644 --- a/provisioning/k8s/commit-boost/templates/service.yaml +++ b/provisioning/k8s/commit-boost/templates/service.yaml @@ -1,3 +1,4 @@ +{{- if .Values.commitBoost.pbs.enable }} apiVersion: v1 kind: Service metadata: @@ -5,15 +6,16 @@ metadata: labels: {{- include "commit-boost.labels" . | nindent 4 }} spec: - type: {{ .Values.service.type }} + type: ClusterIP ports: - - port: {{ .Values.service.port }} + - port: {{ .Values.commitBoost.pbs.config.pbs.port}} name: http-pbs targetPort: http-pbs protocol: TCP - - port: {{ .Values.service.metrics_port }} + - port: {{ .Values.commitBoost.pbs.config.metrics.server_port}} protocol: TCP name: http-metrics targetPort: http-metrics selector: {{- include "commit-boost.selectorLabels" . | nindent 4 }} +{{- end }} \ No newline at end of file diff --git a/provisioning/k8s/commit-boost/values.examples.yaml b/provisioning/k8s/commit-boost/values.examples.yaml new file mode 100644 index 00000000..06187301 --- /dev/null +++ b/provisioning/k8s/commit-boost/values.examples.yaml @@ -0,0 +1,141 @@ +# Default values for commit-boost. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Automatically mount a ServiceAccount's API credentials? + automount: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} +podLabels: {} + +podSecurityContext: + {} + # fsGroup: 2000 + +securityContext: + {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + pbs_port: 18550 + pbs_metrics_port: 10000 + +ingress: + enabled: false + className: "" + annotations: + {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: + {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +# Additional volumes on the output Deployment definition. +volumes: [] +# - name: foo +# secret: +# secretName: mysecret +# optional: false + +# Additional volumeMounts on the output Deployment definition. +volumeMounts: [] +# - name: foo +# mountPath: "/etc/foo" +# readOnly: true + +nodeSelector: {} + +tolerations: [] + +affinity: {} + +serviceMonitor: + enabled: true + additionalLabels: {} + namespace: "" + namespaceSelector: {} + scrapeInterval: 30s + targetLabels: [] + metricRelabelings: [] + path: /metrics + +commitBoost: + pbs: + enable: true + image: + repository: ghcr.io/commit-boost/pbs + pullPolicy: IfNotPresent + tag: "v0.4.0" + config: + chain: "Holesky" + metrics: + server_port: 10000 + prometheus_config: "/dev/null" + pbs: + port: 18550 + timeout_get_header_ms: 900 + late_in_slot_time_ms: 1000 + relays: + - id: "flashbot" + url: "https://0xafa4c6985aa049fb79dd37010438cfebeb0f2bd42b115b89dd678dab0670c1de38da0c4e9138c9290a398ecd9a0b3110@boost-relay-holesky.flashbots.net" + enable_timing_games: false + target_first_request_ms: 500 + frequency_get_header_ms: 100 + mux: + - id: "timing-games" + timeout_get_header_ms: 900 + late_in_slot_time_ms: 1000 + validator_pubkeys: ["0x80c7f782b2467c5898c5516a8b6595d75623960b4afc4f71ee07d40985d20e117ba35e7cd352a3e75fb85a8668a3b745"] + relays: + - id: "flashbot" + url: "https://0xafa4c6985aa049fb79dd37010438cfebeb0f2bd42b115b89dd678dab0670c1de38da0c4e9138c9290a398ecd9a0b3110@boost-relay-holesky.flashbots.net" + enable_timing_games: true + target_first_request_ms: 500 + frequency_get_header_ms: 100 diff --git a/provisioning/k8s/commit-boost/values.yaml b/provisioning/k8s/commit-boost/values.yaml index 1fffd242..24369a46 100644 --- a/provisioning/k8s/commit-boost/values.yaml +++ b/provisioning/k8s/commit-boost/values.yaml @@ -4,11 +4,6 @@ replicaCount: 1 -image: - repository: ghcr.io/commit-boost/pbs - pullPolicy: IfNotPresent - tag: "v0.2.0" - imagePullSecrets: [] nameOverride: "" fullnameOverride: "" @@ -42,8 +37,8 @@ securityContext: service: type: ClusterIP - port: 18550 - metrics_port: 10000 + pbs_port: 18550 + pbs_metrics_port: 10000 ingress: enabled: false @@ -103,19 +98,27 @@ affinity: {} serviceMonitor: enabled: true + additionalLabels: {} + namespace: "" + namespaceSelector: {} scrapeInterval: 30s + targetLabels: [] + metricRelabelings: [] path: /metrics - honorLabels: true - commitBoost: pbs: enable: true - config: |- - chain = "Holesky" - - [pbs] - port = 18550 - - [[relays]] - url = "https://0xafa4c6985aa049fb79dd37010438cfebeb0f2bd42b115b89dd678dab0670c1de38da0c4e9138c9290a398ecd9a0b3110@boost-relay-holesky.flashbots.net" + image: + repository: ghcr.io/commit-boost/pbs + pullPolicy: IfNotPresent + tag: "v0.4.0" + config: + chain: "Holesky" + metrics: + server_port: 10000 + prometheus_config: "/dev/null" + pbs: + port: 18550 + relays: [] + mux: []