Skip to content

Commit

Permalink
feat(charts/contributoor): update config (#352)
Browse files Browse the repository at this point in the history
* feat(charts/contributoor): update config

* cleanup port helper

* cleanup port helper

* fix ports

* exclude contributoor
  • Loading branch information
Savid authored Jan 22, 2025
1 parent 67d375a commit f98c574
Show file tree
Hide file tree
Showing 8 changed files with 102 additions and 70 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test-charts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,4 @@ jobs:
--excluded-charts tracoor-agent
--excluded-charts tracoor-single
--excluded-charts xatu-cl-mimicry
--excluded-charts contributoor
26 changes: 12 additions & 14 deletions charts/contributoor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,10 @@ A lightweight sidecar that runs alongside an Ethereum consensus client and colle
| affinity | object | `{}` | Affinity configuration for pods |
| annotations | object | `{}` | Annotations for the Deployment |
| args | list | `[]` | Command arguments |
| config.beaconNodeAddress | string | `"http://localhost:5052"` | |
| config.contributoorDirectory | string | `"/config/.contributoor"` | |
| config.healthCheckAddress | string | `":9191"` | |
| config.logLevel | string | `"info"` | |
| config.metricsAddress | string | `":9090"` | |
| config.networkName | string | `"NETWORK_NAME_MAINNET"` | |
| config.outputServer.address | string | `"xatu.primary.production.platform.ethpandaops.io:443"` | |
| config.outputServer.credentials | string | `"Someb64Value"` | |
| config.outputServer.tls | bool | `true` | |
| config.runMethod | string | `"RUN_METHOD_DOCKER"` | |
| config.version | string | `"0.0.49"` | |
| beaconNode | object | `{"address":"http://localhost:5052"}` | Beacon node configuration |
| containerSecurityContext | object | See `values.yaml` | The security context for containers |
| customArgs | list | `["--config=/config/config.yaml"]` | Custom args for the contributoor container These are optional, and will be passed to the contributoor container, overriding the values set in 'config'. |
| credentials | object | `{"password":"FILL_ME","username":"FILL_ME"}` | Credentials configuration |
| customArgs | list | `[]` | Custom args for the contributoor container |
| customCommand | list | `[]` | Command replacement for the contributoor container |
| extraContainers | list | `[]` | Additional containers |
| extraEnv | list | `[]` | Additional env variables |
Expand All @@ -35,20 +26,27 @@ A lightweight sidecar that runs alongside an Ethereum consensus client and colle
| extraVolumeMounts | list | `[]` | Additional volume mounts |
| extraVolumes | list | `[]` | Additional volumes |
| fullnameOverride | string | `""` | Overrides the chart's computed fullname |
| healthCheck.enabled | bool | `true` | |
| healthCheck.port | int | `9191` | |
| image.pullPolicy | string | `"IfNotPresent"` | contributoor container pull policy |
| image.repository | string | `"ethpandaops/contributoor"` | contributoor container image repository |
| image.tag | string | `"latest"` | contributoor container image tag |
| imagePullSecrets | list | `[]` | Image pull secrets for Docker images |
| initContainers | list | `[]` | Additional init containers |
| lifecycle | object | See `values.yaml` | Lifecycle hooks |
| livenessProbe | object | `{"httpGet":{"path":"/healthz","port":9191},"initialDelaySeconds":60,"periodSeconds":120}` | Liveness probe |
| livenessProbe | object | `{"httpGet":{"path":"/healthz","port":"health"},"initialDelaySeconds":60,"periodSeconds":120}` | Liveness probe |
| logLevel | string | `"info"` | Log level |
| metrics.enabled | bool | `true` | |
| metrics.port | int | `9090` | |
| nameOverride | string | `""` | Overrides the chart's name |
| network | string | `"mainnet"` | Network name (mainnet, holesky, sepolia) |
| nodeSelector | object | `{}` | Node selector for pods |
| outputServer | object | `{"address":"xatu.primary.production.platform.ethpandaops.io:443","tls":true}` | Output server configuration to send the data to |
| podAnnotations | object | `{}` | Pod annotations |
| podDisruptionBudget | object | `{}` | Define the PodDisruptionBudget spec If not set then a PodDisruptionBudget will not be created |
| podLabels | object | `{}` | Pod labels |
| priorityClassName | string | `nil` | Pod priority class |
| readinessProbe | object | `{"httpGet":{"path":"/healthz","port":9191},"initialDelaySeconds":10,"periodSeconds":10}` | Readiness probe |
| readinessProbe | object | `{"httpGet":{"path":"/healthz","port":"health"},"initialDelaySeconds":10,"periodSeconds":10}` | Readiness probe |
| resources | object | `{}` | Resource requests and limits |
| secretEnv | object | `{}` | Secret env variables injected via a created secret |
| securityContext | object | See `values.yaml` | The security context for pods |
Expand Down
8 changes: 0 additions & 8 deletions charts/contributoor/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,3 @@ Create the name of the service account to use
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{- define "contributoor.healthCheckPort" -}}
{{ (split ":" .Values.config.healthCheckAddress)._2 | default "9191" }}
{{- end -}}

{{- define "contributoor.metricsPort" -}}
{{ (split ":" .Values.config.metricsAddress)._2 | default "9090" }}
{{- end -}}
17 changes: 15 additions & 2 deletions charts/contributoor/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,18 @@ metadata:
labels:
{{- include "contributoor.labels" . | nindent 4 }}
data:
config.yaml: |-
{{ tpl (toYaml .Values.config | nindent 4) $ }}
config.yaml: |
beaconNodeAddress: {{ .Values.beaconNode.address }}
{{- if .Values.metrics.enabled }}
metricsAddress: ":{{ .Values.metrics.port }}"
{{- end }}
{{- if .Values.healthCheck.enabled }}
healthCheckAddress: ":{{ .Values.healthCheck.port }}"
{{- end }}
logLevel: {{ .Values.logLevel }}
networkName: {{ $network := .Values.network | default "mainnet" }}{{ printf "NETWORK_NAME_%s" ($network | upper) }}
outputServer:
address: {{ .Values.outputServer.address | default "xatu.primary.production.platform.ethpandaops.io:443" }}
tls: {{ .Values.outputServer.tls | default "true" }}
contributoorDirectory: "/config/.contributoor"
runMethod: RUN_METHOD_DOCKER
34 changes: 20 additions & 14 deletions charts/contributoor/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,33 +66,39 @@ spec:
{{ toYaml .Values.extraVolumeMounts | nindent 10}}
{{- end }}
ports:
{{- if .Values.config.healthCheckAddress }}
{{- if .Values.healthCheck.enabled }}
- name: health
containerPort: {{ include "contributoor.healthCheckPort" . | atoi }}
containerPort: {{ .Values.healthCheck.port }}
protocol: TCP
{{- end }}
{{- if .Values.config.metricsAddress }}
{{- if .Values.metrics.enabled }}
- name: metrics
containerPort: {{ include "contributoor.metricsPort" . }}
containerPort: {{ .Values.metrics.port }}
protocol: TCP
{{- end }}
{{- if .Values.livenessProbe }}
livenessProbe:
httpGet:
path: /healthz
port: health
initialDelaySeconds: 60
periodSeconds: 120
{{- toYaml .Values.livenessProbe | nindent 10 }}
{{- end }}
{{- if .Values.readinessProbe }}
readinessProbe:
httpGet:
path: /healthz
port: health
initialDelaySeconds: 10
periodSeconds: 10
{{- toYaml .Values.readinessProbe | nindent 10 }}
{{- end }}
lifecycle:
{{- toYaml .Values.lifecycle | nindent 12 }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
env:
- name: CONTRIBUTOOR_USERNAME
valueFrom:
secretKeyRef:
name: {{ .Values.credentials.existingSecret | default (printf "%s-credentials" (include "contributoor.fullname" .)) }}
key: {{ .Values.credentials.usernameKey | default "username" }}
- name: CONTRIBUTOOR_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Values.credentials.existingSecret | default (printf "%s-credentials" (include "contributoor.fullname" .)) }}
key: {{ .Values.credentials.passwordKey | default "password" }}
{{- range $key, $value := .Values.secretEnv }}
- name: {{ $key }}
valueFrom:
Expand Down
17 changes: 17 additions & 0 deletions charts/contributoor/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,20 @@ data:
{{- range $key, $value := .Values.secretEnv }}
{{ $key }}: {{ $value | b64enc }}
{{- end }}
---
{{- if not .Values.credentials.existingSecret }}
apiVersion: v1
kind: Secret
metadata:
name: {{ include "contributoor.fullname" . }}-credentials
labels:
{{- include "contributoor.labels" . | nindent 4 }}
type: Opaque
data:
{{- if .Values.credentials.username }}
username: {{ .Values.credentials.username | b64enc | quote }}
{{- end }}
{{- if .Values.credentials.password }}
password: {{ .Values.credentials.password | b64enc | quote }}
{{- end }}
{{- end }}
8 changes: 4 additions & 4 deletions charts/contributoor/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ metadata:
spec:
type: {{ .Values.service.type }}
ports:
{{- if .Values.config.healthCheckAddress }}
- port: {{ include "contributoor.healthCheckPort" . | atoi }}
{{- if .Values.healthCheck.enabled }}
- port: {{ .Values.healthCheck.port }}
targetPort: health
protocol: TCP
name: health
{{- end }}
{{- if .Values.config.metricsAddress }}
- port: {{ include "contributoor.metricsPort" . }}
{{- if .Values.metrics.enabled }}
- port: {{ .Values.metrics.port }}
targetPort: metrics
protocol: TCP
name: metrics
Expand Down
61 changes: 33 additions & 28 deletions charts/contributoor/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,32 @@ secretEnv: {}
# -- Command arguments
args: []

config:
beaconNodeAddress: http://localhost:5052
metricsAddress: ":9090"
healthCheckAddress: ":9191"
logLevel: info
networkName: NETWORK_NAME_MAINNET
outputServer:
address: xatu.primary.production.platform.ethpandaops.io:443
credentials: Someb64Value
tls: true
version: 0.0.49
contributoorDirectory: /config/.contributoor
runMethod: RUN_METHOD_DOCKER
# -- Beacon node configuration
beaconNode:
address: http://localhost:5052

# -- Log level
logLevel: info # debug, info, warn, error

# -- Network name (mainnet, holesky, sepolia)
network: mainnet

# -- Output server configuration to send the data to
outputServer:
address: xatu.primary.production.platform.ethpandaops.io:443
tls: true

# -- Credentials configuration
credentials:
username: "FILL_ME"
password: "FILL_ME"
# Use existing secret
# existingSecret: ""
# usernameKey: username
# passwordKey: password

# -- Custom args for the contributoor container
# These are optional, and will be passed to the contributoor container, overriding the values set in 'config'.
customArgs:
- --config=/config/config.yaml
# - --network=mainnet
# - --beacon-node-address=http://localhost:5052
# - --metrics-address=:9090
# - --health-check-address=:9191
# - --log-level=info
# - --username=your-username
# - --password=your-password
# - --output-server-address=xatu.primary.production.platform.ethpandaops.io:443
# - --output-server-tls=true
# - --contributoor-directory=/config/.contributoor
customArgs: []

# -- Command replacement for the contributoor container
customCommand: [] # Only change this if you need to change the default command
Expand All @@ -63,19 +61,26 @@ imagePullSecrets: []
# -- Annotations for the Deployment
annotations: {}

metrics:
enabled: true
port: 9090
healthCheck:
enabled: true
port: 9191

# -- Liveness probe
livenessProbe:
httpGet:
path: /healthz
port: 9191
port: health
initialDelaySeconds: 60
periodSeconds: 120

# -- Readiness probe
readinessProbe:
httpGet:
path: /healthz
port: 9191
port: health
initialDelaySeconds: 10
periodSeconds: 10

Expand Down

0 comments on commit f98c574

Please sign in to comment.