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

[bitnami/postgresql] postgresql backup does not have a resources parameter #23938

Closed
axelfauvel opened this issue Feb 27, 2024 · 2 comments · Fixed by #23955
Closed

[bitnami/postgresql] postgresql backup does not have a resources parameter #23938

axelfauvel opened this issue Feb 27, 2024 · 2 comments · Fixed by #23955

Comments

@axelfauvel
Copy link
Contributor

Name and Version

bitnami/postgresql 14.2.3

What is the problem this feature will solve?

On some multi-tenant clusters a resources definition is mandatory for any container to start. Otherwise, you get an error like this :

❯ k describe jobs.batch postgresql-primary-pgdumpall-28482480

Name:             postgresql-primary-pgdumpall-28482480
Namespace:        xxxxxxxx
Selector:         controller-uid=b863d909-887a-43f6-bc1c-b5b08238d7c1
Labels:           app.kubernetes.io/component=pg_dumpall
                  app.kubernetes.io/instance=postgresql
                  app.kubernetes.io/managed-by=Helm
                  app.kubernetes.io/name=postgresql
                  app.kubernetes.io/version=16.2.0
                  controller-uid=b863d909-887a-43f6-bc1c-b5b08238d7c1
                  helm.sh/chart=postgresql-14.0.5
                  job-name=postgresql-primary-pgdumpall-28482480
Annotations:      <none>
Controlled By:    CronJob/postgresql-primary-pgdumpall
Parallelism:      1
Completions:      1
Completion Mode:  NonIndexed
Pods Statuses:    0 Active / 0 Succeeded / 0 Failed
Pod Template:
  Labels:  app.kubernetes.io/component=pg_dumpall
           app.kubernetes.io/instance=postgresql
           app.kubernetes.io/managed-by=Helm
           app.kubernetes.io/name=postgresql
           app.kubernetes.io/version=16.2.0
           controller-uid=b863d909-887a-43f6-bc1c-b5b08238d7c1
           helm.sh/chart=postgresql-14.0.5
           job-name=postgresql-primary-pgdumpall-28482480
  Containers:
   postgresql-primary-pgdumpall:
    Image:           xxxxxxxxx/bitnami/postgresql:16.2.0-debian-11-r1
    Port:            <none>
    Host Port:       <none>
    SeccompProfile:  RuntimeDefault
    Command:
      /bin/sh
      -c
      pg_dumpall --clean --if-exists --load-via-partition-root --quote-all-identifiers --no-password --file=${PGDUMP_DIR}/pg_dumpall-$(date '+%Y-%m-%d-%H-%M').pgdump
    Environment:
      PGUSER:      postgres
      PGPASSWORD:  <set to the key 'postgres-password' in secret 'postgresql'>  Optional: false
      PGHOST:      postgresql-primary
      PGPORT:      5432
      PGDUMP_DIR:  /backup/pgdump
    Mounts:
      /backup/pgdump from datadir (rw)
  Volumes:
   datadir:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  postgresql-primary-pgdumpall
    ReadOnly:   false
Events:
  Type     Reason        Age                   From            Message
  ----     ------        ----                  ----            -------
  Warning  FailedCreate  5m11s (x12 over 70m)  job-controller  (combined from similar events): Error creating: pods "postgresql-primary-pgdumpall-28482480-dzpjr" is forbidden: failed quota: kaas-compute-resources-netbox-services: must specify limits.cpu,limits.memory

In this context, backup can't be used because we can't set resources in values.yaml configuration.

What is the feature you are proposing to solve the problem?

Add a resources block in backup/cronjob.yaml

example of how it's done in primary stateful set

What alternatives have you considered?

No response

@github-actions github-actions bot added the triage Triage is needed label Feb 27, 2024
@javsalgar javsalgar changed the title postgresql backup does not have a resources parameter [bitnami/postgresql] postgresql backup does not have a resources parameter Feb 28, 2024
@javsalgar
Copy link
Contributor

Hi!

Thank you so much for the PR! The team will take a look

@axelfauvel
Copy link
Contributor Author

Wow, awesome thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants