diff --git a/config/crd/bases/awx.ansible.com_awxs.yaml b/config/crd/bases/awx.ansible.com_awxs.yaml index afff46b4..6dbad17a 100644 --- a/config/crd/bases/awx.ansible.com_awxs.yaml +++ b/config/crd/bases/awx.ansible.com_awxs.yaml @@ -165,6 +165,9 @@ spec: control_plane_ee_image: description: Registry path to the Execution Environment container image to use on control plane pods type: string + control_plane_priority_class: + description: Assign a preexisting priority class to the control plane pods + type: string ee_pull_credentials_secret: description: Secret where pull credentials for registered ees can be found type: string @@ -392,6 +395,9 @@ spec: postgres_storage_class: description: Storage class to use for the PostgreSQL PVC type: string + postgres_priority_class: + description: Assign a preexisting priority class to the postgres pod + type: string postgres_data_path: description: Path where the PostgreSQL data are located type: string diff --git a/molecule/default/templates/awx_cr_molecule.yml.j2 b/molecule/default/templates/awx_cr_molecule.yml.j2 index e7c411d7..2c19db8a 100644 --- a/molecule/default/templates/awx_cr_molecule.yml.j2 +++ b/molecule/default/templates/awx_cr_molecule.yml.j2 @@ -25,3 +25,4 @@ spec: requests: cpu: 200m memory: 64M + postgres_resource_requirements: {} diff --git a/roles/installer/defaults/main.yml b/roles/installer/defaults/main.yml index 6e1537b3..b7f35f8a 100644 --- a/roles/installer/defaults/main.yml +++ b/roles/installer/defaults/main.yml @@ -186,6 +186,8 @@ ee_resource_requirements: csrf_cookie_secure: False session_cookie_secure: False +# Assign a preexisting priority class to the control plane pods +control_plane_priority_class: '' # Add extra environment variables to the AWX task/web containers. Specify as # literal block. E.g.: # task_extra_env: | @@ -227,7 +229,12 @@ postgres_storage_requirements: requests: storage: 8Gi postgres_init_container_resource_requirements: {} -postgres_resource_requirements: {} +postgres_resource_requirements: + requests: + cpu: 500m + memory: 1Gi +# Assign a preexisting priority class to the postgres pod +postgres_priority_class: '' postgres_data_path: '/var/lib/postgresql/data/pgdata' # Persistence to the AWX project data folder diff --git a/roles/installer/templates/deployment.yaml.j2 b/roles/installer/templates/deployment.yaml.j2 index 3aff8564..ff150a23 100644 --- a/roles/installer/templates/deployment.yaml.j2 +++ b/roles/installer/templates/deployment.yaml.j2 @@ -41,6 +41,9 @@ spec: {% for secret in image_pull_secrets %} - name: {{ secret }} {% endfor %} +{% endif %} +{% if control_plane_priorityclass is defined %} + priorityClassName: '{{ control_plane_priority_class }}' {% endif %} initContainers: {% if bundle_ca_crt or projects_persistence|bool or init_container_extra_commands %} diff --git a/roles/installer/templates/postgres.yaml.j2 b/roles/installer/templates/postgres.yaml.j2 index 67d12f4c..6caef41a 100644 --- a/roles/installer/templates/postgres.yaml.j2 +++ b/roles/installer/templates/postgres.yaml.j2 @@ -41,6 +41,9 @@ spec: {% for secret in image_pull_secrets %} - name: {{ secret }} {% endfor %} +{% endif %} +{% if postgres_priority_class is defined %} + priorityClassName: '{{ postgres_priority_class }}' {% endif %} initContainers: - name: database-check