Skip to content

fix: add component that configures unicorn pgbouncer image#162

Closed
cross-du wants to merge 4 commits intomainfrom
connection-pooler
Closed

fix: add component that configures unicorn pgbouncer image#162
cross-du wants to merge 4 commits intomainfrom
connection-pooler

Conversation

@cross-du
Copy link
Copy Markdown

Description

The pgbouncer image provided by RapidFort is not configured to work with the upstream chart. This PR adds a Zarf component that sets the correct environment variables and security context for pgbouncer to operate.

Related Issue

Fixes #
https://github.com/defenseunicorns/mission-success/issues/586

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Other (security config, docs update, etc)

Checklist before merging

@cross-du cross-du requested review from a team as code owners February 23, 2026 23:20
@cross-du cross-du changed the title Connection pooler fix: add component that configures unicorn pgbouncer image Feb 23, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 23, 2026

Full scan comparison results are too large to post as a comment. Link to full results artifact: Results
Summarized results are below:

registry1.dso.mil/ironbank/opensource/zalando/postgres-operator

registry1.dso.mil/ironbank/opensource/zalando/postgres-operator v1.15.0 -> v1.15.0

New vulnerabilities: 0
Fixed vulnerabilities: 32
Existing vulnerabilities: 117


registry1.dso.mil/ironbank/opensource/zalando/logical-backup

registry1.dso.mil/ironbank/opensource/zalando/logical-backup v1.8.2 -> v1.15.1

New vulnerabilities: 0
Fixed vulnerabilities: 58
Existing vulnerabilities: 164


registry1.dso.mil/ironbank/opensource/zalando/pgbouncer

registry1.dso.mil/ironbank/opensource/zalando/pgbouncer 1.25.1 -> 1.25.1

New vulnerabilities: 0
Fixed vulnerabilities: 49
Existing vulnerabilities: 157


ghcr.io/zalando/spilo-17

ghcr.io/zalando/spilo-17 4.0-p3 -> 4.0-p3

New vulnerabilities: 4
Fixed vulnerabilities: 3
Existing vulnerabilities: 344


registry1.dso.mil/ironbank/opensource/prometheus/postgres-exporter

registry1.dso.mil/ironbank/opensource/prometheus/postgres-exporter v0.18.1 -> v0.19.0

New vulnerabilities: 0
Fixed vulnerabilities: 50
Existing vulnerabilities: 108


ghcr.io/zalando/postgres-operator

ghcr.io/zalando/postgres-operator v1.15.1 -> v1.15.1

New vulnerabilities: 0
Fixed vulnerabilities: 0
Existing vulnerabilities: 41


ghcr.io/zalando/postgres-operator/logical-backup

ghcr.io/zalando/postgres-operator/logical-backup v1.15.1 -> v1.15.1

New vulnerabilities: 0
Fixed vulnerabilities: 0
Existing vulnerabilities: 298


ghcr.io/cloudnative-pg/pgbouncer

ghcr.io/cloudnative-pg/pgbouncer 1.24.1-23 -> 1.24.1-23

New vulnerabilities: 0
Fixed vulnerabilities: 0
Existing vulnerabilities: 211


ghcr.io/zalando/spilo-17

ghcr.io/zalando/spilo-17 4.0-p3 -> 4.0-p3

New vulnerabilities: 4
Fixed vulnerabilities: 3
Existing vulnerabilities: 344


quay.io/prometheuscommunity/postgres-exporter

quay.io/prometheuscommunity/postgres-exporter v0.18.1 -> v0.19.0

New vulnerabilities: 0
Fixed vulnerabilities: 23
Existing vulnerabilities: 5



generated with uds-pk scan compare

Comment thread common/zarf.yaml
./zarf tools wait-for postgresql pg-cluster -n postgres '{.status.PostgresClusterStatus}'=Running
fi

- name: connection-pooler
Copy link
Copy Markdown
Contributor

@zachariahmiller zachariahmiller Feb 24, 2026

Choose a reason for hiding this comment

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

Flavor specific configurations do not belong in the common/zarf.yaml, but rather the root zarf.yaml

Additionally, I did not dig into it, but this seems like something that is likely able to be set via one of the charts values files. Did you look into if you could do that before taking this approach? Patching resources via kubectl would be the path of last resort for how to configure something.

Finally, why would this be in its own component rather than an onDeploy.after in the existing component?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

So this component should be moved to zarf.yaml?

That would be ideal, but the values for the connection pooler are scant. Maybe a better approach is to create a custom deployment template?

I made it a separate component so I could use only.flavor. Our customer encountered this issue with the unicorn flavor.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, you would be able to do it in the root level zarf.yaml, under the existing unicorn component, instead of in the common/zarf.yaml.

I also wonder though if there is a better way to configure this. If the helm chart does not have values for this, is it something that can be set configurable here?

https://github.com/uds-packages/postgres-operator/blob/main/chart/templates/postgres-minimal.yaml

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Okay, that makes sense. Thanks, Cody.

I'm not sure, but I'll give it a shot.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes and there is already only.flavor in the root level zarf.yaml for unicorn.

Looking at this deeper it seems like the environment vars should be getting set automatically, but the user/group is "wrong" on this particular image and need to be changed for it to function correctly. It also seems like the user/group that gets assigned to the deployment is hardcoded in the go code.

I need to look into this more, but it seems like the ideal fix is probably swapping out the image, the provider offers several versions.

In order to ensure the proposed change can be validated and not become a problem again, but could you please provide a minimal reproduction of the issue(a test) that would replicate the problem. We generally will add such tests when we run into something like this to ensure we dont have regressions, especially if we change image providers. I can take that and validate all the flavors and bring back to the provider to either have them update the image we are using or get an entitlement to a different image and see if it can be resolved that way.

Thanks.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

It's not possible to set security context or environment vars in postgres-minimal.yaml. The extent of the connection pooler's configuration can be found here.

The docs also state that security context is hard coded.
image

Would moving the component to the root zarf.yaml be okay, or should I figure out how to deploy a custom template?

@cross-du cross-du closed this Feb 24, 2026
@cross-du cross-du deleted the connection-pooler branch February 24, 2026 21:24
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.

3 participants