# Postgres init container missing resources

**URL:** <https://forum.ansible.com/t/postgres-init-container-missing-resources/37188>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [October 6, 2022, 7:34pm UTC](https://forum.ansible.com/t/postgres-init-container-missing-resources/37188 "2022-10-06T19:34:23Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kaushik\_R](https://avatars.discourse-cdn.com/v4/letter/k/c67d28/32.png) [@Kaushik\_R](https://forum.ansible.com/u/Kaushik_R)\
**Post date:** [October 6, 2022, 7:34pm UTC](https://forum.ansible.com/t/postgres-init-container-missing-resources/37188/1 "2022-10-06T19:34:23Z")

</div>

Hi,

My postgres init container is crashing as there’s no resources defined under [https://github.com/ansible/awx-operator/blob/0.30.0/roles/installer/templates/deployments/deployment.yaml.j2](https://github.com/ansible/awx-operator/blob/0.30.0/roles/installer/templates/deployments/deployment.yaml.j2)

Can we please have resources(requests/limits) defined for the init container?

---

<div class="post-metadata">

**Author:** ![AWX\_Project](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@AWX\_Project](https://forum.ansible.com/u/AWX_Project)\
**Post date:** [October 7, 2022, 5:20pm UTC](https://forum.ansible.com/t/postgres-init-container-missing-resources/37188/2 "2022-10-07T17:20:55Z")

</div>

What logs/errors are you experiencing that you suspect is related to pod resources / limits? feel free to post those in a reply and we’ll take a look!

AWX Team

---

<div class="post-metadata">

**Author:** ![Kaushik\_R](https://avatars.discourse-cdn.com/v4/letter/k/c67d28/32.png) [@Kaushik\_R](https://forum.ansible.com/u/Kaushik_R)\
**Post date:** [October 10, 2022, 6:58pm UTC](https://forum.ansible.com/t/postgres-init-container-missing-resources/37188/3 "2022-10-10T18:58:26Z")

</div>

Below is the error and I’m anticipating it’s because of the postgres init container missing requests/limits -

_Error creating: pods “awx-67cb856d46-lftfx” is forbidden: failed quota: ansible-awx-quota: must specify limits.cpu,limits.memory,requests.cpu,requests.memory_

I have requests/limits assigned to all other containers within the AWX pod (awx-67cb856d46-lftfx").

---

<div class="post-metadata">

**Author:** ![Kaushik\_R](https://avatars.discourse-cdn.com/v4/letter/k/c67d28/32.png) [@Kaushik\_R](https://forum.ansible.com/u/Kaushik_R)\
**Post date:** [October 11, 2022, 8:41pm UTC](https://forum.ansible.com/t/postgres-init-container-missing-resources/37188/4 "2022-10-11T20:41:31Z")

</div>

Any inputs?

---

<div class="post-metadata">

**Author:** ![AWX\_Project](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@AWX\_Project](https://forum.ansible.com/u/AWX_Project)\
**Post date:** [October 13, 2022, 4:20pm UTC](https://forum.ansible.com/t/postgres-init-container-missing-resources/37188/5 "2022-10-13T16:20:33Z")

</div>

Hi!

you can set postgres\_init\_container\_resource\_requirements for the initContainers, see [https://github.com/ansible/awx-operator#managed-postgresql-service](https://github.com/ansible/awx-operator#managed-postgresql-service)

However, you may still run into the same error for the task container init containers

see this PR which makes the task initContainers inherit the resource limits for task\_resource\_requirements [https://github.com/ansible/awx-operator/pull/1084](https://github.com/ansible/awx-operator/pull/1084)

For now you should be able to configure LimitRanges in k8s, which will give the initContainers resource limits [https://kubernetes.io/docs/concepts/policy/limit-range/](https://kubernetes.io/docs/concepts/policy/limit-range/)

let us know if this helps!

AWX Team

---

<div class="post-metadata">

**Author:** ![Kaushik\_R](https://avatars.discourse-cdn.com/v4/letter/k/c67d28/32.png) [@Kaushik\_R](https://forum.ansible.com/u/Kaushik_R)\
**Post date:** [October 13, 2022, 6:05pm UTC](https://forum.ansible.com/t/postgres-init-container-missing-resources/37188/6 "2022-10-13T18:05:44Z")

</div>

Thanks - will these PR changes be updated in the upcoming awx-operator version?

---

<div class="post-metadata">

**Author:** ![AWX\_Project](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@AWX\_Project](https://forum.ansible.com/u/AWX_Project)\
**Post date:** [October 14, 2022, 5:22pm UTC](https://forum.ansible.com/t/postgres-init-container-missing-resources/37188/7 "2022-10-14T17:22:55Z")

</div>

Yes should be in the next operator release!
