From 0f07a475b5b2ac53685fa1c58a1cb677a1472b66 Mon Sep 17 00:00:00 2001 From: chris93111 Date: Sun, 10 Oct 2021 16:00:06 +0200 Subject: [PATCH 1/2] Add ability to configure extra args for postgres * add default extra args postgres * add postgres_extra_args option to readme --- README.md | 3 +++ config/crd/bases/awx.ansible.com_awxs.yaml | 4 ++++ roles/installer/templates/postgres.yaml.j2 | 3 +++ 3 files changed, 10 insertions(+) diff --git a/README.md b/README.md index 6cf9a2d9..462d3d3d 100644 --- a/README.md +++ b/README.md @@ -422,6 +422,9 @@ spec: limits: storage: 50Gi postgres_storage_class: fast-ssd + postgres_extra_args: + - '-c' + - 'max_connections=1000' ``` **Note**: If `postgres_storage_class` is not defined, Postgres will store it's data on a volume using the default storage class for your cluster. diff --git a/config/crd/bases/awx.ansible.com_awxs.yaml b/config/crd/bases/awx.ansible.com_awxs.yaml index 3f7f5d00..988b01d0 100644 --- a/config/crd/bases/awx.ansible.com_awxs.yaml +++ b/config/crd/bases/awx.ansible.com_awxs.yaml @@ -362,6 +362,10 @@ spec: postgres_data_path: description: Path where the PostgreSQL data are located type: string + postgres_extra_args: + type: array + items: + type: string ca_trust_bundle: description: Path where the trusted CA bundle is available type: string diff --git a/roles/installer/templates/postgres.yaml.j2 b/roles/installer/templates/postgres.yaml.j2 index 185c0373..817485c7 100644 --- a/roles/installer/templates/postgres.yaml.j2 +++ b/roles/installer/templates/postgres.yaml.j2 @@ -41,6 +41,9 @@ spec: - image: '{{ _postgres_image }}' imagePullPolicy: '{{ image_pull_policy }}' name: postgres +{% if postgres_extra_args %} + args: {{ postgres_extra_args }} +{% endif %} env: # For postgres_image based on rhel8/postgresql-12 - name: POSTGRESQL_DATABASE From cbd7da9dcfce520eea78d34bf755e9a4afedc601 Mon Sep 17 00:00:00 2001 From: "Christian M. Adams" Date: Tue, 11 Jan 2022 14:18:34 -0500 Subject: [PATCH 2/2] Add default for postgres_extra_args variable --- roles/installer/defaults/main.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/roles/installer/defaults/main.yml b/roles/installer/defaults/main.yml index df7f13e3..dadb7877 100644 --- a/roles/installer/defaults/main.yml +++ b/roles/installer/defaults/main.yml @@ -215,6 +215,9 @@ projects_persistence: false # Define an existing PersistentVolumeClaim to use projects_existing_claim: '' # +# Define postgres configuration arguments to use +postgres_extra_args: '' + # Define the storage_class, size and access_mode # when not using an existing claim projects_storage_size: 8Gi