From dfa0f6d45e0ed08a92a1484115eae62b4ec5b2ef Mon Sep 17 00:00:00 2001 From: "Christian M. Adams" Date: Wed, 20 Apr 2022 20:23:33 -0400 Subject: [PATCH] Add docs for priority classes & fix typo --- README.md | 19 +++++++++++++++++++ roles/installer/templates/deployment.yaml.j2 | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c88a011f..fee0431b 100644 --- a/README.md +++ b/README.md @@ -442,6 +442,7 @@ The following variables are customizable for the managed PostgreSQL service | postgres_storage_requirements | PostgreSQL container storage requirements | requests: {storage: 8Gi} | | postgres_storage_class | PostgreSQL PV storage class | Empty string | | postgres_data_path | PostgreSQL data path | `/var/lib/postgresql/data/pgdata` | +| postgres_priority_class | Priority class used for PostgreSQL pod | Empty string | Example of customization could be: @@ -576,6 +577,24 @@ spec: memory: 2Gi ``` +#### Priority Classes + +The AWX and Postgres pods can be assigned a custom PriorityClass to rank their importance compared to other pods in your cluster, which determines which pods get evicted first if resources are running low. +First, [create your PriorityClass](https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/#priorityclass) if needed. +Then set the name of your priority class to the control plane and postgres pods as shown below. + +```yaml +--- +apiVersion: awx.ansible.com/v1beta1 +kind: AWX +metadata: + name: awx-demo +spec: + ... + control_plane_priority_class: awx-demo-high-priority + postgres_priority_class: awx-demo-medium-priority +``` + #### Assigning AWX pods to specific nodes You can constrain the AWX pods created by the operator to run on a certain subset of nodes. `node_selector` and `postgres_selector` constrains diff --git a/roles/installer/templates/deployment.yaml.j2 b/roles/installer/templates/deployment.yaml.j2 index ff150a23..955e3ae3 100644 --- a/roles/installer/templates/deployment.yaml.j2 +++ b/roles/installer/templates/deployment.yaml.j2 @@ -42,7 +42,7 @@ spec: - name: {{ secret }} {% endfor %} {% endif %} -{% if control_plane_priorityclass is defined %} +{% if control_plane_priority_class is defined %} priorityClassName: '{{ control_plane_priority_class }}' {% endif %} initContainers: