Skip to content

Set cluster_labels for template CronJob #1834

@felrivero

Description

@felrivero
  • Which image of the operator are you using? registry.opensource.zalan.do/acid/postgres-operator:v1.7.1
  • Where do you run it - cloud or metal? Kubernetes or OpenShift? Bare Metal K8s
  • Are you running Postgres Operator in production? no
  • Type of issue? Bug report

Hi! thank you for this great operator.
I installed postgres-operator with option and all work fine.

configKubernetes:
  cluster_labels:
    app.kubernetes.io/name: db-postgres

But when I set up logical backups and a CronJob is created, it does not inherit the necessary labels along the way - spec/jobTemplate/spec/template/metadata/labels
Only default values (cluster-name and application) without app.kubernetes.io/name: db-postgres:

apiVersion: batch/v1
kind: CronJob
metadata:
  labels:
    app.kubernetes.io/name: db-postgres
    application: spilo
    cluster-name: my-cluster
    team: dba
spec:
  jobTemplate:
    spec:
      template:
        metadata:
          labels:
            application: spilo-logical-backup
            cluster-name: my-cluster

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions