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

K8SPG-651 - Update PG charts for 2.6.0 release #459

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

jvpasinatto
Copy link
Contributor

No description provided.

@jvpasinatto jvpasinatto added the pg label Feb 6, 2025
@CorentinRegnier
Copy link

Any news for this PR ? We forked this repository because of this missing keys today

@sekot
Copy link

sekot commented Feb 25, 2025

+1

@jvpasinatto
Copy link
Contributor Author

Hello @CorentinRegnier,
This release was delayed by a few weeks due to a recent CVE in PostgreSQL packages.

Are you interested in a specific change being made in this PR?

…s` (#462)

* K8SPG-619: add `restartPolicy` and `backoffLimit` to `.pgbackrest.jobs`

https://perconadev.atlassian.net/browse/K8SPG-619

* update README

---------

Co-authored-by: Julio Pasinatto <[email protected]>
@CorentinRegnier
Copy link

CorentinRegnier commented Feb 27, 2025

💡 Enhancement Proposal: Add Resource Requests for Containers

Hi @jvpasinatto 👋,

I noticed that some containers in the solution do not currently handle the resources.requests section, which may impact resource allocation and overall stability.
This PR introduces support for requests in addition to the existing limits for all relevant containers.

📌 Changes Introduced:

  • Added support for requests (cpu and memory) for:
    • replicaCertCopy
    • pgBouncerConfig
    • pgbackrest
    • pgbackrestConfig
    • pgbackrest.jobs
    • pgbackrest.repoHost
  • Added support for limits (cpu and memory) for:
    • pgbackrest.repoHost
  • Preserved the existing limits handling.

This will help improve resource allocation and workload stability 🚀.

🔍 Diff of the Changes:

diff --git a/charts/pg-db/templates/official_cluster_pg_db_2_5_3.yaml b/charts/pg-db/templates/cluster.yaml
+++ b/charts/pg-db/templates/cluster.yaml
@@ -200,6 +200,11 @@ spec:
         replicaCertCopy:
           {{- if $instance.containers.replicaCertCopy.resources }}
           resources:
+            {{- if $instance.containers.replicaCertCopy.resources.requests }}
+            requests:
+              cpu: {{ $instance.containers.replicaCertCopy.resources.requests.cpu }}
+              memory: {{ $instance.containers.replicaCertCopy.resources.requests.memory }}
+            {{- end }}
             {{- if $instance.containers.replicaCertCopy.resources.limits }}
             limits:
               cpu: {{ $instance.containers.replicaCertCopy.resources.limits.cpu }}
@@ -300,6 +305,11 @@ spec:
         pgbouncerConfig:
           {{- if .Values.proxy.pgBouncer.containers.pgbouncerConfig.resources }}
           resources:
+            {{- if .Values.proxy.pgBouncer.containers.pgbouncerConfig.resources.requests }}
+            requests:
+              cpu: {{ .Values.proxy.pgBouncer.containers.pgbouncerConfig.resources.requests.cpu }}
+              memory: {{ .Values.proxy.pgBouncer.containers.pgbouncerConfig.resources.requests.memory }}
+            {{- end }}
             {{- if .Values.proxy.pgBouncer.containers.pgbouncerConfig.resources.limits }}
             limits:
               cpu: {{ .Values.proxy.pgBouncer.containers.pgbouncerConfig.resources.limits.cpu }}
@@ -386,6 +396,11 @@ spec:
         pgbackrest:
           {{- if .Values.backups.pgbackrest.containers.pgbackrest.resources }}
           resources:
+            {{- if .Values.backups.pgbackrest.containers.pgbackrest.resources.requests }}
+            requests:
+              cpu: {{ .Values.backups.pgbackrest.containers.pgbackrest.resources.requests.cpu }}
+              memory: {{ .Values.backups.pgbackrest.containers.pgbackrest.resources.requests.memory }}
+            {{- end }}
             {{- if .Values.backups.pgbackrest.containers.pgbackrest.resources.limits }}
             limits:
               cpu: {{ .Values.backups.pgbackrest.containers.pgbackrest.resources.limits.cpu }}
@@ -397,6 +412,11 @@ spec:
         pgbackrestConfig:
           {{- if .Values.backups.pgbackrest.containers.pgbackrestConfig.resources }}
           resources:
+            {{- if .Values.backups.pgbackrest.containers.pgbackrestConfig.resources.requests }}
+            requests:
+              cpu: {{ .Values.backups.pgbackrest.containers.pgbackrestConfig.resources.requests.cpu }}
+              memory: {{ .Values.backups.pgbackrest.containers.pgbackrestConfig.resources.requests.memory }}
+            {{- end }}
             {{- if .Values.backups.pgbackrest.containers.pgbackrestConfig.resources.limits }}
             limits:
               cpu: {{ .Values.backups.pgbackrest.containers.pgbackrestConfig.resources.limits.cpu }}
@@ -408,10 +428,19 @@ spec:
       {{- if .Values.backups.pgbackrest.jobs }}
       jobs:
         priorityClassName: {{ .Values.backups.pgbackrest.jobs.priorityClassName }}
+        {{- if .Values.backups.pgbackrest.jobs.resources }}
         resources:
+          {{- if .Values.backups.pgbackrest.jobs.resources.requests }}
+          requests:
+            cpu: {{ .Values.backups.pgbackrest.jobs.resources.requests.cpu }}
+            memory: {{ .Values.backups.pgbackrest.jobs.resources.requests.memory }}
+          {{- end}}
+          {{- if .Values.backups.pgbackrest.jobs.resources.limits }}
           limits:
             cpu: {{ .Values.backups.pgbackrest.jobs.resources.limits.cpu }}
             memory: {{ .Values.backups.pgbackrest.jobs.resources.limits.memory }}
+          {{- end}}
+        {{- end}}
         {{- if .Values.backups.pgbackrest.jobs.tolerations }}
         tolerations:
 {{ .Values.backups.pgbackrest.jobs.tolerations | toYaml | indent 10 }}
@@ -427,6 +456,19 @@ spec:
       {{- end }}
       {{- if .Values.backups.pgbackrest.repoHost }}
       repoHost:
+        {{- if .Values.backups.pgbackrest.repoHost.resources }}
+        resources:
+          {{- if .Values.backups.pgbackrest.repoHost.resources.requests }}
+          requests:
+            cpu: {{ .Values.backups.pgbackrest.repoHost.resources.requests.cpu }}
+            memory: {{ .Values.backups.pgbackrest.repoHost.resources.requests.memory }}
+          {{- end }}
+          {{- if .Values.backups.pgbackrest.containers.pgbackrestConfig.resources.limits }}
+          limits:
+            cpu: {{ .Values.backups.pgbackrest.repoHost.resources.limits.cpu }}
+            memory: {{ .Values.backups.pgbackrest.repoHost.resources.limits.memory }}
+          {{- end }}
+        {{- end }}
         priorityClassName: {{ .Values.backups.pgbackrest.repoHost.priorityClassName }}
         {{- if .Values.backups.pgbackrest.repoHost.topologySpreadConstraints }}
         topologySpreadConstraints:

Please feel free to share any feedback! Thanks in advance for your review and support 🙌.

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

Successfully merging this pull request may close these issues.

6 participants