postgres-operator icon indicating copy to clipboard operation
postgres-operator copied to clipboard

Cannot enable instrumentation when only use s3 as backup repo

Open vbeaucha opened this issue 6 months ago • 0 comments

Overview

I'm trying to enable instrumentation instead of pgmonitor inside a cluster that only use S3 bucket as repo for pgbackuprest. Pods are unable to start due to logrotate-config's key missing inside the associated config map.

I notice, there is not the same condition to setup collector to use logrotate configuration than added it to the config map.

Use logrotate-config map ( didn't check if repo.volume is setup ): https://github.com/CrunchyData/postgres-operator/blob/861fac3630e463be53850da17051209e3cebe969/internal/controller/postgrescluster/instance.go#L1224-L1226

Add logroate-config to config map ( check if repo.volume is setup ) : https://github.com/CrunchyData/postgres-operator/blob/861fac3630e463be53850da17051209e3cebe969/internal/controller/postgrescluster/instance.go#L1438-L1441

Environment

Please provide the following details:

  • Platform: EKS
  • Platform Version: 1.31.5
  • PGO Image Tag: ubi9-5.8.2-0
  • Postgres Version: 17

Steps to Reproduce

REPRO

Create a new cluster with instrumentation enable and a pgbackrest configuration's repo that not use volumes directive ( using s3 or something else )

EXPECTED

Be able to start cluster with pgbackuprest enable without using a repo setup has volume and instrumentation enable.

Additional Information

Postgres cluster's manifest

apiVersion: postgres-operator.crunchydata.com/v1beta1
kind: PostgresCluster
metadata:
  name: pg
  namespace: pg
spec:
  backups:
    pgbackrest:
      configuration:
      - secret:
          name: XXXX
      global:
        repo1-path: /pgbackrest/repo1
        repo1-retention-full: "15"
      image: registry.developers.crunchydata.com/crunchydata/crunchy-pgbackrest:ubi8-2.54.1-0
      repos:
      - name: repo1
        s3:
          bucket: XXX
          endpoint: XXX
          region: XXX
        schedules:
          full: 0 5 * * 6
          incremental: 0 */4 * * 0-5
  image: registry.developers.crunchydata.com/crunchydata/crunchy-postgres-gis:ubi9-17.5-3.5-2520
  instances:
    dataVolumeClaimSpec:
      accessModes:
      - ReadWriteOnce
      resources:
        requests:
          storage: 60Gi
    name: pgha1
    replicas: 2
  instrumentation:
    logs:
      retentionPeriod: 2d
  port: 5432
  postgresVersion: 17
  shutdown: false

vbeaucha avatar Jun 16 '25 17:06 vbeaucha