Skip to content

Cannot enable instrumentation when only use s3 as backup repo #4194

Open
@vbeaucha

Description

@vbeaucha

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 ):

collector.AddToPod(ctx, cluster.Spec.Instrumentation, cluster.Spec.ImagePullPolicy, instanceConfigMap, &instance.Spec.Template,
[]corev1.VolumeMount{postgres.DataVolumeMount()}, pgPassword,
[]string{naming.PGBackRestPGDataLogPath}, backupsSpecFound, true)

Add logroate-config to config map ( check if repo.volume is setup ) :

if err == nil &&
feature.Enabled(ctx, feature.OpenTelemetryLogs) &&
pgbackrest.RepoHostVolumeDefined(cluster) &&
cluster.Spec.Instrumentation != nil {

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions