Skip to content
Open
1,577 changes: 1,577 additions & 0 deletions build/crd/percona/generated/pgv2.percona.com_perconapgclusters.yaml

Large diffs are not rendered by default.

1,577 changes: 1,577 additions & 0 deletions config/crd/bases/pgv2.percona.com_perconapgclusters.yaml

Large diffs are not rendered by default.

18 changes: 15 additions & 3 deletions deploy/cr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -379,11 +379,23 @@ spec:
matchLabels:
postgres-operator.crunchydata.com/data: pgbackrest
topologyKey: kubernetes.io/hostname
env:
- name: AWS_WEB_IDENTITY_TOKEN_FILE
value: "/var/run/secrets/eks.amazonaws.com/serviceaccount/token"
- name: AWS_ROLE_ARN
value: "arn:aws:iam::123456789012:role/my-role"
# Add sidecars to the repo host pod
sidecars:
- name: s3-helper
image: amazon/aws-cli:latest
command: ["sleep"]
args: ["infinity"]
resources:
limits:
cpu: 100m
memory: 128Mi
# tolerations:
# - effect: NoSchedule
# key: role
# operator: Equal
# value: connection-poolers
# priorityClassName: high-priority
#
# topologySpreadConstraints:
Expand Down
11 changes: 10 additions & 1 deletion internal/controller/postgrescluster/pgbackrest.go
Original file line number Diff line number Diff line change
Expand Up @@ -645,9 +645,18 @@ func (r *Reconciler) generateRepoHostIntent(ctx context.Context, postgresCluster
postgresCluster.Spec.ImagePullPolicy,
&repo.Spec.Template)

// Add sidecars from the spec if defined
if pgbackrest := postgresCluster.Spec.Backups.PGBackRest; pgbackrest.RepoHost != nil &&
len(pgbackrest.RepoHost.Sidecars) > 0 {
// Add each sidecar container to the pod spec
repo.Spec.Template.Spec.Containers = append(
Copy link
Member

@senyosimpson senyosimpson Mar 11, 2025

Choose a reason for hiding this comment

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

fwiw, you'd actually want to add this to initContainers and have a restart policy set to Always for the container. that ensures it actually starts before the main program

repo.Spec.Template.Spec.Containers,
pgbackrest.RepoHost.Sidecars...)
}

resources := corev1.ResourceRequirements{}
if postgresCluster.Spec.Backups.PGBackRest.RepoHost != nil {
resources = postgresCluster.Spec.Backups.PGBackRest.RepoHost.Resources
resources = postgresCluster.Spec.Backups.PGBackRest.RepoHost.Resources
}
sizeLimit := getTMPSizeLimit(repo.Labels[naming.LabelVersion], resources)

Expand Down
Loading