Skip to content

Commit

Permalink
stackgres 14+ changes
Browse files Browse the repository at this point in the history
Signed-off-by: Jesse Nelson <[email protected]>
  • Loading branch information
jnels124 committed Dec 21, 2024
1 parent 67c7afd commit a56f1fa
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 14 deletions.
2 changes: 1 addition & 1 deletion charts/hedera-mirror-common/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dependencies:
condition: stackgres.enabled
name: stackgres-operator
repository: https://stackgres.io/downloads/stackgres-k8s/stackgres/helm/
version: 1.13.0
version: 1.14.1
- condition: traefik.enabled
name: traefik
repository: https://helm.traefik.io/traefik
Expand Down
45 changes: 44 additions & 1 deletion charts/hedera-mirror-common/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -417,10 +417,53 @@ promtail:
operator: Exists

stackgres:
collector:
config:
exporters:
prometheus:
metric_expiration: 2m
service:
pipelines:
metrics:
receivers:
- prometheus/prometheus # This appears to be corrected to just prometheus in 1.15+ and can be updated (possibly removed) when upgrading
resources:
limits:
memory: "4Gi"
cpu: "1500m"
requests:
memory: "3Gi"
cpu: "1000m"
prometheusOperator:
monitors:
- name: mirror-prometheus-prometheus # Should be able to rename this in 1.15+
metadata:
namespace: common
name: mirror-prometheus-prometheus
spec:
podMetricsEndpoints:
- honorLabels: true
honorTimestamps: true
interval: 1m
metricRelabelings:
- action: drop
regex: ^(pg_stat.*_user.*|pg_table.*|pg_total_relation_size_bytes|pg.*)$
sourceLabels:
- __name__
path: /metrics
port: prom-http
scheme: https
tlsConfig:
ca:
secret:
key: tls.crt
name: mirror-prometheus-prometheus
serverName: stackgres-collector

enabled: false
operator:
image:
name: gcr.io/mirrornode/stackgres-operator
name: docker.io/xinatswirlds/stackgres-operator
prometheusRules:
enabled: true
DatabaseStorageFull:
Expand Down
15 changes: 9 additions & 6 deletions charts/hedera-mirror/templates/stackgres/stackgres-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@ metadata:
name: {{ include "hedera-mirror.stackgres" . }}
namespace: {{ include "hedera-mirror.namespace" . }}
spec:
{{- if .Values.stackgres.backup.enabled }}
configurations:
{{- if .Values.stackgres.backup.enabled }}
backups:
{{- range $backupConfig := .Values.stackgres.backup.instances }}
- sgObjectStorage: {{ include "hedera-mirror.stackgres" $ }}-object-storage
{{$backupConfig | toYaml | nindent 6}}
{{- end }}
{{- end }}
{{- end }}
observability:
disableMetrics: {{ not .Values.stackgres.observability.enableMetricsExporter }}
prometheusAutobind: {{ .Values.stackgres.observability.enableMetricsExporter }}
coordinator:
configurations:
sgPoolingConfig: {{ include "hedera-mirror.stackgres" . }}-coordinator
Expand All @@ -23,7 +26,6 @@ spec:
scripts:
- sgScript: {{ include "hedera-mirror.stackgres" . }}-coordinator
pods:
disableMetricsExporter: {{ not .Values.stackgres.coordinator.enableMetricsExporter }}
disablePostgresUtil: {{ not .Values.stackgres.coordinator.enablePostgresUtil }}
persistentVolume: {{ .Values.stackgres.coordinator.persistentVolume | toYaml | nindent 8 }}
resources:
Expand Down Expand Up @@ -51,9 +53,11 @@ spec:
ssl:
enabled: false # Disable SSL to work around https://github.com/hashgraph/hedera-mirror-node/issues/9143
version: {{ .Values.stackgres.postgresVersion | quote }}
prometheusAutobind: {{ or .Values.stackgres.coordinator.enableMetricsExporter .Values.stackgres.worker.enableMetricsExporter }}
prometheusAutobind: {{ .Values.stackgres.observability.enableMetricsExporter }}
replication:
mode: {{ .Values.stackgres.coordinator.replication.mode }}
mode: {{ .Values.stackgres.replication.mode }}
initialization:
mode: {{ .Values.stackgres.replication.initialization.mode }}
shards:
clusters: {{ .Values.stackgres.worker.instances }}
configurations:
Expand All @@ -65,7 +69,6 @@ spec:
- sgScript: {{ include "hedera-mirror.stackgres" . }}-worker
overrides: {{ .Values.stackgres.worker.overrides | toYaml | nindent 6 }}
pods:
disableMetricsExporter: {{ not .Values.stackgres.worker.enableMetricsExporter }}
disablePostgresUtil: {{ not .Values.stackgres.worker.enablePostgresUtil }}
persistentVolume: {{ .Values.stackgres.worker.persistentVolume | toYaml | nindent 8 }}
resources:
Expand Down
4 changes: 2 additions & 2 deletions charts/hedera-mirror/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@ stackgres:
cronSchedule: "45 22 * * *"
compression: lz4
useVolumeSnapshot: true
fastVolumeSnapshot: false # Can be true once StackGres issue 2887 is resolved
fastVolumeSnapshot: true
volumeSnapshotClass: zfs
performance:
uploadDiskConcurrency: 1 # Can be 4 once StackGres issue 2887 is resolved
uploadDiskConcurrency: 1
objectStorage:
endpoint: http://mirror-minio.common:9000
bucket: stackgres-backup
Expand Down
10 changes: 6 additions & 4 deletions charts/hedera-mirror/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,6 @@ stackgres:
wal_init_zero: "off" # Not needed with ZFS
wal_recycle: "off" # Not needed with ZFS
work_mem: "12MB"
enableMetricsExporter: false
enablePostgresUtil: true
instances: 1
pgbouncer:
Expand All @@ -325,8 +324,6 @@ stackgres:
pool_mode: session
mirror_importer:
pool_mode: session
replication:
mode: sync-all
resources:
cpu: 100m
memory: 1Gi
Expand All @@ -342,9 +339,15 @@ stackgres:
- name: pg_trgm
version: "1.6"
nameOverride: citus
observability:
enableMetricsExporter: true
podAntiAffinity: true
postgresVersion: "16.2"
priorityClassName: ""
replication:
initialization:
mode: FromReplica
mode: sync-all
worker:
config:
autovacuum_max_workers: "2"
Expand All @@ -362,7 +365,6 @@ stackgres:
wal_init_zero: "off" # Not needed with ZFS
wal_recycle: "off" # Not needed with ZFS
work_mem: "12MB"
enableMetricsExporter: false
enablePostgresUtil: true
instances: 1
overrides: [] # Override shard(s) configuration
Expand Down

0 comments on commit a56f1fa

Please sign in to comment.