Skip to content

Commit

Permalink
Adding postgres annotations support (ansible#1829)
Browse files Browse the repository at this point in the history
* Adding postgres annotations support

Authored-by: Imed Aouidene <[email protected]>
  • Loading branch information
imedaouidene authored Jul 24, 2024
1 parent d427379 commit 8224b0b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions config/crd/bases/awx.ansible.com_awxs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,9 @@ spec:
web_annotations:
description: Web deployment annotations. This will override the general annotations parameter for the Web deployment.
type: string
postgres_annotations:
description: Annotations to add to the Postgres deployment.
type: string
tolerations:
description: node tolerations for the pods
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -951,6 +951,11 @@ spec:
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- urn:alm:descriptor:com.tectonic.ui:hidden
- displayName: Postgres Annotations
path: postgres_annotations
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- urn:alm:descriptor:com.tectonic.ui:hidden
- displayName: Tolerations
path: tolerations
x-descriptors:
Expand Down
6 changes: 6 additions & 0 deletions roles/installer/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,12 @@ task_annotations: ''
# my.web-annotation/2: value2
web_annotations: ''

# Add annotations to postgres pod. Specify as literal block. E.g.:
# postgres_annotations: |
# my.annotation/1: value
# my.annotation/2: value2
postgres_annotations: ''

admin_user: admin
admin_email: [email protected]

Expand Down
3 changes: 3 additions & 0 deletions roles/installer/templates/statefulsets/postgres.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ spec:
app.kubernetes.io/component: 'database'
app.kubernetes.io/part-of: '{{ ansible_operator_meta.name }}'
app.kubernetes.io/managed-by: '{{ deployment_type }}-operator'
{% if postgres_annotations %}
{{ postgres_annotations | indent(width=8) }}
{% endif %}
spec:
{% if image_pull_secret is defined %}
imagePullSecrets:
Expand Down

0 comments on commit 8224b0b

Please sign in to comment.