Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(charts/forky): add postgresql #340

Merged
merged 2 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions charts/forky/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.38
digest: sha256:f67c7612736803ece8a669f8ca6b0555f3b78557bc0ecb732aa2e43f0df7750d
generated: "2024-10-04T09:44:02.943593963+10:00"
7 changes: 6 additions & 1 deletion charts/forky/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@ name: forky
description: A beacon chain fork choice viewer
home: https://github.com/ethpandaops/forky
type: application
version: 0.1.2
version: 0.2.0
maintainers:
- name: samcm
email: sam.calder-mason@ethereum.org
- name: savid
email: andrew.davis@ethereum.org
dependencies:
- name: postgresql
version: "15.x.x"
repository: "https://charts.bitnami.com/bitnami"
condition: postgresql.enabled
25 changes: 24 additions & 1 deletion charts/forky/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@

# forky

![Version: 0.1.2](https://img.shields.io/badge/Version-0.1.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
![Version: 0.2.0](https://img.shields.io/badge/Version-0.2.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)

A beacon chain fork choice viewer

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

## Requirements

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

## Values

| Key | Type | Default | Description |
Expand Down Expand Up @@ -54,6 +60,23 @@ A beacon chain fork choice viewer
| 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.architecture | string | `"standalone"` | |
| 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 | `false` | If enabled a postgres chart will be deployed as a dependency |
| postgresql.fullnameOverride | string | `""` | |
| postgresql.image.registry | string | `"docker.io"` | |
| postgresql.image.repository | string | `"bitnami/postgresql"` | |
| postgresql.image.tag | string | `"16.4.0-debian-12-r2"` | |
| postgresql.nameOverride | string | `""` | |
| postgresql.primary.extendedConfiguration | string | `"max_connections = 1024\n"` | |
| postgresql.primary.persistence.enabled | bool | `true` | |
| postgresql.primary.persistence.size | string | `"8Gi"` | |
| postgresql.primary.resources | object | `{}` | |
| 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
13 changes: 13 additions & 0 deletions charts/forky/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,16 @@ Create the name of the service account to use
{{- define "forky.metricsPort" -}}
{{ (split ":" .Values.config.metrics.addr)._1 | default ":9090" }}
{{- end -}}

{{- define "forky.postgresql.fullname" -}}
{{- if .Values.postgresql.fullnameOverride -}}
{{- .Values.postgresql.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default "postgresql" .Values.postgresql.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}
7 changes: 6 additions & 1 deletion charts/forky/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,9 @@ metadata:
{{- include "forky.labels" . | nindent 4 }}
data:
config.yaml: |-
{{ toYaml .Values.config | nindent 4 }}
{{- $config := deepCopy .Values.config -}}
{{- if .Values.postgresql.enabled -}}
{{- $_ := set $config.forky.indexer "dsn" (printf "postgres://%s:%s@%s:5432/%s?sslmode=disable" .Values.postgresql.auth.username .Values.postgresql.auth.password (include "forky.postgresql.fullname" $) .Values.postgresql.auth.database) -}}
{{- $_ := set $config.forky.indexer "driver_name" "postgres" -}}
{{- end -}}
{{ toYaml $config | nindent 4 }}
29 changes: 29 additions & 0 deletions charts/forky/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,13 @@ config:
store:
type: memory

# If postgresql.enabled = true, this block will be overwritten.
indexer:
dsn: ":memory:"
driver_name: sqlite
# Example file sqlite:
# dsn: "file:/data/forky.db"
# driver_name: sqlite

sources:
- name: "example"
Expand Down Expand Up @@ -230,3 +234,28 @@ serviceMonitor:
scrapeTimeout: 30s
# -- ServiceMonitor relabelings
relabelings: []

postgresql:
# -- If enabled a postgres chart will be deployed as a dependency
enabled: false
nameOverride: ""
fullnameOverride: ""
architecture: "standalone"
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
resources: {}
Loading