zalando / postgres-operator

Postgres operator creates and manages PostgreSQL clusters running in Kubernetes
https://postgres-operator.readthedocs.io/
MIT License
4.33k stars 979 forks source link

Any way to configure pod annotation to logical backup job pods? #1053

Open kimxogus opened 4 years ago

kimxogus commented 4 years ago

We are running istio in our cluster and istio-proxy sidecar is enabled by default.

When logical backup pod is up, as few seconds needed to init istio-proxy sidecar, logical backup pod's log shows as below.

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (7) Failed to connect to 100.64.0.1 port 443: Connection refused

Is there any way to configure pod annotation to job pods? or can you add support for this?

FxKu commented 4 years ago

You can specify podAnnotations in the cluster manifets. These will also be used by the logical backup job.

kimxogus commented 4 years ago

I did that as workaround, but I hope to enable istio for postgres pods and disable istio to logical backup pods

laukaichung commented 3 years ago

I started using linkerd and ran into the same issue. Looking at the source code, there is no way to add extra annotations just for logical backup cron jobs. All of the cron jobs can not be completed because of the sidecar proxy container.

laukaichung commented 3 years ago

I use Linkerd as a service mesh. I just integrated the logical backup image with Linkerd-await. It will gracefully shut down Linkerd's proxy sidecar container when the backup job is finished. Istio has a similar wrapper application called scuttle.

Just changed the configmap from

logical_backup_docker_image: "registry.opensource.zalan.do/acid/logical-backup:v1.6.2"

to

logical_backup_docker_image: "watchdict/linkerd-await-postgres-operator-logical-backup:0.9"

https://github.com/linkerd/linkerd-await My Dockerfile: https://github.com/laukaichung/linkerd-await-postgres-operator-logical-backup