From 718e5cfcb942469efd6aa5e183bd9cb855938e61 Mon Sep 17 00:00:00 2001 From: Christian Adams Date: Thu, 2 Nov 2023 12:54:15 -0400 Subject: [PATCH] =?UTF-8?q?Add=20sample=20AWX=20CR=20with=20resource=20lim?= =?UTF-8?q?its=20for=20environments=20with=20Resource=E2=80=A6=20(#1554)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add sample AWX CR with resource limits for environments with ResourceQuotas --- .../awx_v1beta1_awx_resource_limits.yaml | 55 ++++++++++++++ .../containers-resource-requirements.md | 72 ++++++++++++++----- 2 files changed, 110 insertions(+), 17 deletions(-) create mode 100644 config/samples/awx_v1beta1_awx_resource_limits.yaml diff --git a/config/samples/awx_v1beta1_awx_resource_limits.yaml b/config/samples/awx_v1beta1_awx_resource_limits.yaml new file mode 100644 index 000000000..45681d560 --- /dev/null +++ b/config/samples/awx_v1beta1_awx_resource_limits.yaml @@ -0,0 +1,55 @@ +--- +apiVersion: awx.ansible.com/v1beta1 +kind: AWX +metadata: + name: awx-with-limits +spec: + task_resource_requirements: + requests: + cpu: 100m + memory: 128Mi + limits: + cpu: 2000m + memory: 4Gi + web_resource_requirements: + requests: + cpu: 100m + memory: 128Mi + limits: + cpu: 1000m + memory: 4Gi + ee_resource_requirements: + requests: + cpu: 100m + memory: 64Mi + limits: + cpu: 1000m + memory: 4Gi + redis_resource_requirements: + requests: + cpu: 50m + memory: 64Mi + limits: + cpu: 1000m + memory: 4Gi + rsyslog_resource_requirements: + requests: + cpu: 100m + memory: 128Mi + limits: + cpu: 1000m + memory: 2Gi + init_container_resource_requirements: + requests: + cpu: 100m + memory: 128Mi + limits: + cpu: 1000m + memory: 2Gi + postgres_init_container_resource_requirements: + requests: + cpu: 10m + memory: 64Mi + limits: + cpu: 1000m + memory: 2Gi diff --git a/docs/user-guide/advanced-configuration/containers-resource-requirements.md b/docs/user-guide/advanced-configuration/containers-resource-requirements.md index 0615a8193..6dbec7bd5 100644 --- a/docs/user-guide/advanced-configuration/containers-resource-requirements.md +++ b/docs/user-guide/advanced-configuration/containers-resource-requirements.md @@ -26,7 +26,13 @@ The resource requirements for both, the task and the web containers are configur | -------------------------- | ------------------------------------------------ | ------------------------------------ | | web_resource_requirements | Web container resource requirements | requests: {cpu: 100m, memory: 128Mi} | | task_resource_requirements | Task container resource requirements | requests: {cpu: 100m, memory: 128Mi} | -| ee_resource_requirements | EE control plane container resource requirements | requests: {cpu: 100m, memory: 128Mi} | +| ee_resource_requirements | EE control plane container resource requirements | requests: {cpu: 50m, memory: 64Mi} | +| redis_resource_requirements | Redis container resource requirements | requests: {cpu: 100m, memory: 128Mi} | +| postgres_resource_requirements | Postgres container resource requirements | requests: {cpu: 10m, memory: 64Mi} | +| rsyslog_resource_requirements | Rsyslog container resource requirements | requests: {cpu: 100m, memory: 128Mi} | +| init_container_resource_requirements | Init Container resource requirements | requests: {cpu: 100m, memory: 128Mi} | +| postgres_init_container_resource_requirements | Postgres Init Container resource requirements | requests: {cpu: 10m, memory: 64Mi} | + Example of customization could be: @@ -34,31 +40,63 @@ Example of customization could be: --- spec: ... - web_resource_requirements: + + task_resource_requirements: requests: - cpu: 250m - memory: 2Gi + cpu: 100m + memory: 128Mi ephemeral-storage: 100M limits: - cpu: 1000m + cpu: 2000m memory: 4Gi ephemeral-storage: 500M - task_resource_requirements: + web_resource_requirements: requests: - cpu: 250m - memory: 1Gi - ephemeral-storage: 100M + cpu: 100m + memory: 128Mi limits: - cpu: 2000m - memory: 2Gi - ephemeral-storage: 500M + cpu: 1000m + memory: 4Gi ee_resource_requirements: requests: - cpu: 250m - memory: 100Mi - ephemeral-storage: 100M + cpu: 100m + memory: 64Mi + limits: + cpu: 1000m + memory: 4Gi + redis_resource_requirements: + requests: + cpu: 50m + memory: 64Mi + limits: + cpu: 1000m + memory: 4Gi + rsyslog_resource_requirements: + requests: + cpu: 100m + memory: 128Mi limits: - cpu: 500m + cpu: 1000m + memory: 2Gi + init_container_resource_requirements: + requests: + cpu: 100m + memory: 128Mi + limits: + cpu: 1000m + memory: 2Gi + postgres_init_container_resource_requirements: + requests: + cpu: 10m + memory: 64Mi + limits: + cpu: 1000m memory: 2Gi - ephemeral-storage: 500M ``` + + +#### Limits and ResourceQuotas + +If the cluster you are deploying in has a ResoruceQuota, you will need to configure resource limits for all of the pods deployed in that cluster. This can be done for AWX pods on the AWX spec in the manner shown above. + +There is an example you can use in [`config/samples/awx_v1beta1_awx_resource_limits.yaml`](../../../config/samples/awx_v1beta1_awx_resource_limits.yaml).