Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions common/zarf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,33 @@ components:
if ./zarf tools kubectl get postgresql pg-cluster -n postgres; then
./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?

required: true
only:
flavor: unicorn
actions:
onDeploy:
after:
- description: Configure unicorn connection pooler image
maxTotalSeconds: 300
cmd: |
CLUSTER_NAME=$(./zarf tools kubectl get postgresql -n postgres -o jsonpath='{.items[0].metadata.name}')

if [[ -z "$CLUSTER_NAME" ]]; then
echo "No Postgres cluster found in 'postgres' namespace. Skipping..."
exit 0
fi

POOLER_ENABLED=$(./zarf tools kubectl get postgresql -n postgres $CLUSTER_NAME -o jsonpath='{.spec.enableConnectionPooler}')

if [[ "$POOLER_ENABLED" == "true" ]]; then
echo "Configuring connection-pooler"
./zarf tools wait-for deployment "$CLUSTER_NAME-pooler" -n postgres exists
./zarf tools kubectl set env -n postgres deployment "$CLUSTER_NAME-pooler" DATABASES_HOST="$CLUSTER_NAME" PGBOUNCER_LISTEN_PORT=5432
./zarf tools kubectl patch deployment "$CLUSTER_NAME-pooler" -n postgres -p \
'{"spec":{"template":{"metadata":{"labels":{"uds/user":"70","uds/group":"70","uds/fsgroup":"70"}}}}}'
./zarf tools wait-for deployment "$CLUSTER_NAME-pooler" -n postgres
else
echo "Connection pooler not enabled."
fi
6 changes: 3 additions & 3 deletions releaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
flavors:
- name: upstream
# renovate-uds: datasource=docker depName=ghcr.io/zalando/postgres-operator extractVersion=^v?(?<version>\d+\.\d+\.\d+)$
version: 1.15.1-uds.1
version: 1.15.1-uds.2
- name: registry1
# renovate-uds: datasource=docker depName=registry1.dso.mil/ironbank/opensource/zalando/postgres-operator extractVersion=^v?(?<version>\d+\.\d+\.\d+)$
version: 1.15.0-uds.1
version: 1.15.0-uds.2
- name: unicorn
# renovate-uds: datasource=docker depName=quay.io/rfcurated/zalando/postgres-operator extractVersion=^v?(?<version>\d+\.\d+\.\d+)$
version: 1.15.0-uds.1
version: 1.15.0-uds.2
7 changes: 7 additions & 0 deletions zarf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,10 @@ components:
- quay.io/rfcurated/zalando/spilo-17:4.0-p3-jammy-fips-rfcurated
# Container image that provides the postgres-exporter sidecar to create a metrics endpoint
- quay.io/rfcurated/prometheuscommunity/postgres-exporter:0.19-jammy-scratch-bnt-fips-rfcurated

- name: connection-pooler
required: true
only:
flavor: unicorn
import:
path: common
Loading