# Postgres pods custom annotations

**URL:** <https://forums.percona.com/t/postgres-pods-custom-annotations/22326>\
**Category:** PostgreSQL\
**Created:** [May 26, 2023, 8:25am UTC](https://forums.percona.com/t/postgres-pods-custom-annotations/22326 "2023-05-26T08:25:38Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![VNuser](https://avatars.discourse-cdn.com/v4/letter/v/e480ec/32.png) [@VNuser](https://forums.percona.com/u/VNuser)\
**Post date:** [May 26, 2023, 8:25am UTC](https://forums.percona.com/t/postgres-pods-custom-annotations/22326/1 "2023-05-26T08:25:38Z")

</div>

Hi,  
Need to pass custom annotations to Postgres pods so that velero backup tool could do full backups (including storage)

One finding, if add in crd “`pgclusters.pg.percona.com`” required annotation line it will do what is required

```auto
k get pgclusters.pg.percona.com test-db-pg-db -oyaml|grep global -A 3
    global:
      backup.velero.io/backup-volumes: pgdata
      keep-backups: "false"
      keep-data: "true"
      
// Pods are immediate restarted with annotations included

k get pod pod-name -oyaml |grep annotations: -A 1
  annotations:
    backup.velero.io/backup-volumes: pgdata

```

Please advise how to add annotations using helm deployment  
Helm charts [used](https://github.com/percona/percona-helm-charts)

Thanks in advance

---

<div class="post-metadata">

**Author:** ![Sergey\_Pronin](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/sergey_pronin/32/14887_2.png) [@Sergey\_Pronin](https://forums.percona.com/u/Sergey_Pronin)\
**Post date:** [May 26, 2023, 9:05am UTC](https://forums.percona.com/t/postgres-pods-custom-annotations/22326/2 "2023-05-26T09:05:46Z")

</div>

Hello @VNuser ,

which version of the operator are you using? if you are just starting, I would recommend using v2 ([Percona Operator for PostgreSQL](https://docs.percona.com/percona-operator-for-postgresql/2.0/index.html))

---

<div class="post-metadata">

**Author:** ![VNuser](https://avatars.discourse-cdn.com/v4/letter/v/e480ec/32.png) [@VNuser](https://forums.percona.com/u/VNuser)\
**Post date:** [May 26, 2023, 12:47pm UTC](https://forums.percona.com/t/postgres-pods-custom-annotations/22326/3 "2023-05-26T12:47:05Z")

</div>

Hi @Sergey_Pronin,

Thanks for quick response, it looks like we are using older version 1.4.0

Actually we are using it for a while could be 3-4 month, this annotation question rise due to velero tool introduction!

Latest version is capable of doing this?

Thanks  
Vitaly

---

<div class="post-metadata">

**Author:** ![VNuser](https://avatars.discourse-cdn.com/v4/letter/v/e480ec/32.png) [@VNuser](https://forums.percona.com/u/VNuser)\
**Post date:** [June 14, 2023, 1:50pm UTC](https://forums.percona.com/t/postgres-pods-custom-annotations/22326/4 "2023-06-14T13:50:13Z")

</div>

Hi @Sergey_Pronin ,

Might had some time to check on this ?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![Sergey\_Pronin](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/sergey_pronin/32/14887_2.png) [@Sergey\_Pronin](https://forums.percona.com/u/Sergey_Pronin)\
**Post date:** [June 16, 2023, 9:33am UTC](https://forums.percona.com/t/postgres-pods-custom-annotations/22326/5 "2023-06-16T09:33:27Z")

</div>

In short you need to add `annotations` section under `pgPrimary` to make it work the way you need.  
I created this PR: [K8SPG-393 Update cluster.yaml custom annotations by spron-in · Pull Request #223 · percona/percona-helm-charts · GitHub](https://github.com/percona/percona-helm-charts/pull/223)

It addresses your request.

Also I would strongly recommend to use Percona Operator v2 instead: [Percona Operator for PostgreSQL](https://docs.percona.com/percona-operator-for-postgresql/2.0/)

---

<div class="post-metadata">

**Author:** ![VNuser](https://avatars.discourse-cdn.com/v4/letter/v/e480ec/32.png) [@VNuser](https://forums.percona.com/u/VNuser)\
**Post date:** [June 19, 2023, 9:22am UTC](https://forums.percona.com/t/postgres-pods-custom-annotations/22326/6 "2023-06-19T09:22:44Z")

</div>

@Sergey_Pronin , thank you a **TON**!  
We did investigation regarding v2 version, and first comment when open v2

* * *

This is version 2.1.0 of the Percona Operator for PostgreSQL. It is a **tech preview release** and it is **not recommended for production environments.**

We decide to stick with 1.4

Thanks, will monitor change implementation!

---

<div class="post-metadata">

**Author:** ![Sergey\_Pronin](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/sergey_pronin/32/14887_2.png) [@Sergey\_Pronin](https://forums.percona.com/u/Sergey_Pronin)\
**Post date:** [June 19, 2023, 9:53am UTC](https://forums.percona.com/t/postgres-pods-custom-annotations/22326/7 "2023-06-19T09:53:48Z")

</div>

@VNuser ,

glad I was able to help.

P.S. 2.X will go GA this month, so I would strongly suggest to consider using it 🙂

---

<div class="post-metadata">

**Author:** ![VNuser](https://avatars.discourse-cdn.com/v4/letter/v/e480ec/32.png) [@VNuser](https://forums.percona.com/u/VNuser)\
**Post date:** [June 19, 2023, 10:15am UTC](https://forums.percona.com/t/postgres-pods-custom-annotations/22326/8 "2023-06-19T10:15:41Z")

</div>

@Sergey_Pronin thanks for suggestion!  
will consider with collages this version and steps of mitigation

---

<div class="post-metadata">

**Author:** ![VNuser](https://avatars.discourse-cdn.com/v4/letter/v/e480ec/32.png) [@VNuser](https://forums.percona.com/u/VNuser)\
**Post date:** [June 20, 2023, 7:25am UTC](https://forums.percona.com/t/postgres-pods-custom-annotations/22326/9 "2023-06-20T07:25:04Z")

</div>

Hi @Sergey_Pronin, we discuss with colleagues, and we could go with newer version, is upgrade path available? How this could impact running database clusters?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![Sergey\_Pronin](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/sergey_pronin/32/14887_2.png) [@Sergey\_Pronin](https://forums.percona.com/u/Sergey_Pronin)\
**Post date:** [June 23, 2023, 8:22am UTC](https://forums.percona.com/t/postgres-pods-custom-annotations/22326/10 "2023-06-23T08:22:19Z")

</div>

There will be three paths to upgrade. You can read about them in this preview doc: [Upgrade overview - Percona Operator for PostgreSQL](https://percona-postgresql-operator-2-0-pr-60.onrender.com/update.html)

Please note, that some of these procedures will not work till the latest release which is coming this month.  
Once we do a release, the doc will be available in our official docs.

---

<div class="post-metadata">

**Author:** ![VNuser](https://avatars.discourse-cdn.com/v4/letter/v/e480ec/32.png) [@VNuser](https://forums.percona.com/u/VNuser)\
**Post date:** [June 26, 2023, 7:21am UTC](https://forums.percona.com/t/postgres-pods-custom-annotations/22326/11 "2023-06-26T07:21:11Z")

</div>

@Sergey_Pronin, thanks a ton!
