Skip to content

Add explicit resource blocks for managed workloads#32

Merged
serdardalgic merged 5 commits into
cybertec-postgresql:mainfrom
adrianeliasson:feature/add-explicit-resource-block-for-managed-workloads
Jun 9, 2026
Merged

Add explicit resource blocks for managed workloads#32
serdardalgic merged 5 commits into
cybertec-postgresql:mainfrom
adrianeliasson:feature/add-explicit-resource-block-for-managed-workloads

Conversation

@adrianeliasson

Copy link
Copy Markdown
Contributor

Closes #30

Explicitly set the resource block on all managed workloads (default empty object on all workloads to avoid breaking changes). Also allow setting the resource values through the Values file for all managed workloads:

  • DB init job
  • Grafana deployment
  • Prometheus deployment
  • PGWatch deployment
  • The Metrics Database backend

Explicitly set the resource block on all managed workloads (default
empty on all to avoid breaking changes). Also allow setting the resource
values through the Values file for all managed workloads:
- DB init job
- Grafana deployment
- Prometheus deployment
- PGWatch deployment
- The Metrics Database backend

@serdardalgic serdardalgic left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, the PR looks good to me, thank you @adrianeliasson .

One small nitpick about the naming conventions, variables start with lowercase letters.

Other than that, if you want, you can add low values you mentioned in your comment as commented-out example suggestions for init jobs and initContainers. However, I'd rather not add active defaults or recommendations for the main workloads such as PostgreSQL, Prometheus, Grafana, or Pgwatch itself.

Resource requirements vary significantly depending on workload size, scrape interval, number of monitored DBs, retention settings, dashboards, etc. In my opinion, bad defaults are worse than no defaults. Because of that, I would suggest keeping the scope of this implementation focused on providing the functionality, while leaving actual resource sizing decisions to users.

Could you also add a short section to the README.md describing how to configure resource blocks for the built-in workloads, so users are aware of this functionality?

After your fixes, I think the PR is good to go. Thanks again for your work. 👏

Comment thread helm/pgwatch/values.yaml Outdated
size: '10Gi'
storageClass: 'standard'
# -- Resource requests and limits for the Metrics Database init job.
DbInitJob:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
DbInitJob:
dbInitJob:

According to Helm Naming Conventions:

Variable names should begin with a lowercase letter, and words should be separated with camelcase:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing it out, fixed!

@serdardalgic

Copy link
Copy Markdown
Collaborator

Hi @adrianeliasson 👋
In addition to those minor changes, could you also add a single line in CHANGELOG.md describing the change you made?

I'd be happy to include this in the next release once the PR is ready to merge. If you need anything, please don't hesitate to nudge :)

- Adds a readme entry detailing how to manually set resource limits and
requests
- Adds example resource requests and limit for init jobs
- Use helm naming convention for all values names (lower camelcase)
@adrianeliasson

Copy link
Copy Markdown
Contributor Author

Hey @serdardalgic, thanks for your feedback.

See changes:

  • Commented out example resources for init jobs
  • Example of manually setting resources in the README.md file
  • Follow naming convention for variable dbInitJob
  • Added CHANGELOG entry to mention this addition

Please let me know what you think :)

@serdardalgic serdardalgic left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @adrianeliasson , that's solid, LGTM 👍
Once the Changelog entry is in the right place, I'd happily approve the PR and merge into main.

Comment thread helm/pgwatch/CHANGELOG.md Outdated
### Added

- `seccompProfile.type: RuntimeDefault` in global `securityContext.pod` defaults when `securityContext.enabled=true` ([#31](https://github.com/cybertec-postgresql/pgwatch-charts/issues/31)).
- The ability to manually specify `resources` blocks on managed workloads.([#30](https://github.com/cybertec-postgresql/pgwatch-charts/issues/30)).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should go to the Unreleased part of Changelog. 4.0.1 is already released.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, now I see it. Thanks!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now it should be in the right place.

@serdardalgic serdardalgic left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Thank you very much for your contribution! 🎉

@serdardalgic serdardalgic merged commit a8dd771 into cybertec-postgresql:main Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add configurable resource requests and limits for built-in workloads

2 participants