Skip to content

Commit

Permalink
feat(charts/tracoor-single): default to postgre (#335)
Browse files Browse the repository at this point in the history
* feat(charts/tracoor-single): default to postgres
  • Loading branch information
Savid committed Aug 28, 2024
1 parent 3104764 commit 68785b0
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 10 deletions.
6 changes: 6 additions & 0 deletions charts/tracoor-single/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: postgresql
repository: https://charts.bitnami.com/bitnami
version: 15.5.23
digest: sha256:a73e983312ae193a283a720706a0b231907bfce54513b459c830704497640bb4
generated: "2024-08-23T11:54:16.007074244+10:00"
7 changes: 6 additions & 1 deletion charts/tracoor-single/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@ name: tracoor-single
description: Ethereum debug data capture and indexer
home: https://github.com/ethpandaops/tracoor
type: application
version: 0.0.3
version: 0.0.4
maintainers:
- name: samcm
email: [email protected]
- name: savid
email: [email protected]
dependencies:
- name: postgresql
version: "15.x.x"
repository: "https://charts.bitnami.com/bitnami"
condition: postgresql.enabled
25 changes: 22 additions & 3 deletions charts/tracoor-single/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@

# tracoor-single

![Version: 0.0.3](https://img.shields.io/badge/Version-0.0.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
![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)

Ethereum debug data capture and indexer

**Homepage:** <https://github.com/ethpandaops/tracoor>

## Requirements

| Repository | Name | Version |
|------------|------|---------|
| https://charts.bitnami.com/bitnami | postgresql | 15.x.x |

## Values

| Key | Type | Default | Description |
Expand All @@ -28,8 +34,7 @@ Ethereum debug data capture and indexer
| config.server.addr | string | `":8081"` | |
| config.server.gatewayAddr | string | `":8080"` | |
| config.server.ntpServer | string | `"time.google.com"` | |
| config.server.persistence.driver_name | string | `"sqlite"` | |
| config.server.persistence.dsn | string | `"file:/data/tracoor.db"` | |
| config.server.persistence | object | `{}` | |
| config.server.pprofAddr | string | `":6060"` | |
| config.server.preStopSleepSeconds | int | `1` | |
| config.server.services.indexer.retention.beaconBlocks | string | `"30m"` | |
Expand Down Expand Up @@ -79,6 +84,20 @@ Ethereum debug data capture and indexer
| podAnnotations | object | `{}` | Pod annotations |
| podDisruptionBudget | object | `{}` | Define the PodDisruptionBudget spec If not set then a PodDisruptionBudget will not be created |
| podLabels | object | `{}` | Pod labels |
| postgresql.auth.database | string | `"tracoor"` | |
| postgresql.auth.enablePostgresUser | bool | `true` | |
| postgresql.auth.password | string | `"postgres"` | |
| postgresql.auth.postgresPassword | string | `"postgres"` | |
| postgresql.auth.username | string | `"postgres"` | |
| postgresql.enabled | bool | `true` | |
| postgresql.image.registry | string | `"docker.io"` | |
| postgresql.image.repository | string | `"bitnami/postgresql"` | |
| postgresql.image.tag | string | `"16.4.0-debian-12-r2"` | |
| postgresql.name | string | `"{{ .Release.Name }}-postgresql"` | If enabled a postgres chart will be deployed as a dependency |
| postgresql.persistence.enabled | bool | `true` | |
| postgresql.persistence.size | string | `"8Gi"` | |
| postgresql.primary.extendedConfiguration | string | `"max_connections = 1024\n"` | |
| postgresql.pullPolicy | string | `"IfNotPresent"` | |
| priorityClassName | string | `nil` | Pod priority class |
| readinessProbe | object | See `values.yaml` | Readiness probe |
| replicas | int | `1` | Number of replicas |
Expand Down
7 changes: 6 additions & 1 deletion charts/tracoor-single/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,9 @@ metadata:
{{- include "tracoor-single.labels" . | nindent 4 }}
data:
config.yaml: |-
{{ toYaml .Values.config | nindent 4 }}
{{- $config := deepCopy .Values.config -}}
{{- if .Values.postgresql.enabled -}}
{{- $_ := set $config.server.persistence "dsn" (printf "postgres://%s:%s@%s:5432/%s?sslmode=disable" .Values.postgresql.auth.username .Values.postgresql.auth.password (tpl .Values.postgresql.name $) .Values.postgresql.auth.database) -}}
{{- $_ := set $config.server.persistence "driver_name" "postgres" -}}
{{- end -}}
{{ toYaml $config | nindent 4 }}
32 changes: 27 additions & 5 deletions charts/tracoor-single/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ config:
pprofAddr: ":6060"
preStopSleepSeconds: 1
ntpServer: time.google.com

persistence:
dsn: "file:/data/tracoor.db"
driver_name: sqlite

persistence: {}
# If postgres.enabled = true, this block will be overwritten.
# Example sqlite:
# dsn: "file:/data/tracoor.db"
# driver_name: sqlite
services:
indexer:
retention:
Expand Down Expand Up @@ -303,3 +303,25 @@ serviceMonitor:
scrapeTimeout: 30s
# -- ServiceMonitor relabelings
relabelings: []

postgresql:
# -- If enabled a postgres chart will be deployed as a dependency
name: "{{ .Release.Name }}-postgresql"
enabled: true
image:
registry: docker.io
repository: bitnami/postgresql
tag: 16.4.0-debian-12-r2
pullPolicy: IfNotPresent
auth:
enablePostgresUser: true
postgresPassword: postgres
database: tracoor
username: postgres
password: postgres
primary:
extendedConfiguration: |
max_connections = 1024
persistence:
enabled: true
size: 8Gi

0 comments on commit 68785b0

Please sign in to comment.