Skip to content

Commit

Permalink
Add default resource requests for postgres containers
Browse files Browse the repository at this point in the history
  • Loading branch information
rooftopcellist authored and fosterseth committed Apr 18, 2022
1 parent 5372771 commit 21062f0
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 29 deletions.
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -434,14 +434,14 @@ If you don't have access to an external PostgreSQL service, the AWX operator can

The following variables are customizable for the managed PostgreSQL service

| Name | Description | Default |
| --------------------------------------------- | --------------------------------------------- | --------------------------------- |
| postgres_image | Path of the image to pull | postgres:12 |
| postgres_init_container_resource_requirements | Database init container resource requirements | requests: {} |
| postgres_resource_requirements | PostgreSQL container resource requirements | requests: {} |
| 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` |
| Name | Description | Default |
| --------------------------------------------- | --------------------------------------------- | ---------------------------------- |
| postgres_image | Path of the image to pull | postgres:12 |
| postgres_init_container_resource_requirements | Database init container resource requirements | requests: {cpu: 10m, memory: 64Mi} |
| postgres_resource_requirements | PostgreSQL container resource requirements | requests: {cpu: 10m, memory: 64Mi} |
| 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` |

Example of customization could be:

Expand Down Expand Up @@ -541,11 +541,11 @@ Again, this is the most relaxed SCC that is provided by OpenShift, so be sure to

The resource requirements for both, the task and the web containers are configurable - both the lower end (requests) and the upper end (limits).

| Name | Description | Default |
| -------------------------- | ------------------------------------------------ | ----------------------------------- |
| web_resource_requirements | Web container resource requirements | requests: {cpu: 1000m, memory: 2Gi} |
| task_resource_requirements | Task container resource requirements | requests: {cpu: 500m, memory: 1Gi} |
| ee_resource_requirements | EE control plane container resource requirements | requests: {cpu: 500m, memory: 1Gi} |
| Name | Description | Default |
| -------------------------- | ------------------------------------------------ | ------------------------------------ |
| 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} |

Example of customization could be:

Expand All @@ -555,24 +555,24 @@ spec:
...
web_resource_requirements:
requests:
cpu: 1000m
cpu: 250m
memory: 2Gi
limits:
cpu: 2000m
cpu: 1000m
memory: 4Gi
task_resource_requirements:
requests:
cpu: 500m
cpu: 250m
memory: 1Gi
limits:
cpu: 1000m
cpu: 2000m
memory: 2Gi
ee_resource_requirements:
requests:
cpu: 500m
memory: 1Gi
cpu: 250m
memory: 100Mi
limits:
cpu: 1000m
cpu: 500m
memory: 2Gi
```

Expand Down
21 changes: 12 additions & 9 deletions roles/installer/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,18 +169,18 @@ web_command: []

task_resource_requirements:
requests:
cpu: 500m
memory: 1Gi
cpu: 100m
memory: 128Mi

web_resource_requirements:
requests:
cpu: 1000m
memory: 2Gi
cpu: 100m
memory: 128Mi

ee_resource_requirements:
requests:
cpu: 500m
memory: 1Gi
cpu: 100m
memory: 64Mi

# Customize CSRF options
csrf_cookie_secure: False
Expand Down Expand Up @@ -228,11 +228,14 @@ postgres_tolerations: ''
postgres_storage_requirements:
requests:
storage: 8Gi
postgres_init_container_resource_requirements: {}
postgres_resource_requirements:
requests:
cpu: 500m
memory: 1Gi
cpu: 10m
memory: 64Mi
postgres_init_container_resource_requirements:
requests:
cpu: 10m
memory: 64Mi
# Assign a preexisting priority class to the postgres pod
postgres_priority_class: ''
postgres_data_path: '/var/lib/postgresql/data/pgdata'
Expand Down

0 comments on commit 21062f0

Please sign in to comment.