# AWX-Operator Installation error on awx-postgres-0

**URL:** <https://forum.ansible.com/t/awx-operator-installation-error-on-awx-postgres-0/35056>\
**Category:** AWX Project\
**Tags:** kubernetes, awx\
**Created:** [April 26, 2021, 12:51pm UTC](https://forum.ansible.com/t/awx-operator-installation-error-on-awx-postgres-0/35056 "2021-04-26T12:51:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ariel\_Masciotta](https://avatars.discourse-cdn.com/v4/letter/a/dec6dc/32.png) [@Ariel\_Masciotta](https://forum.ansible.com/u/Ariel_Masciotta)\
**Post date:** [April 26, 2021, 12:51pm UTC](https://forum.ansible.com/t/awx-operator-installation-error-on-awx-postgres-0/35056/1 "2021-04-26T12:51:11Z")

</div>

Hello everyone.  
I’ve used Tower for a long while now, on a daily basis, but I’m pretty new to installing an AWX instance in my kubernetes cluster. (For testing purposes).  
So, I’ve setup 2 Centos 8, installed and configured a 2 node kubernetes cluster, and then tried to install AWX through the AWX\_Operator.  
In the past, I’ve successfully installed a trial version of ansible tower seamlessly, but AWX is giving me some headaches.  
So, here’s what I’m doing:  
As per AWX\_Operator installation guide ([https://github.com/ansible/awx-operator/blob/devel/README.md](https://github.com/ansible/awx-operator/blob/devel/README.md)), I’ve ran the following:  
#\> kubectl apply -f [https://raw.githubusercontent.com/ansible/awx-operator/0.8.0/deploy/awx-operator.yaml](https://raw.githubusercontent.com/ansible/awx-operator/0.8.0/deploy/awx-operator.yaml)  
I had my awx-operator-xxxxx pod created.  
then I create a my-awx.yml file with the following:

— apiVersion: [awx.ansible.com/v1beta1](http://awx.ansible.com/v1beta1)  
kind: AWX  
metadata:  
name: awx

Then I run kubectl apply -f my-awx.yml  
After a short while, I can see the services created, but awx-postgres-0 in a pending state.  
When I describe the pod, I can see that it’s not being able to create its storage:  
default-scheduler 0/2 nodes are available: 2 pod has unbound immediate PersistentVolumeClaims.

Could someone let me know why I’m experiencing this error? I’m pretty new to k8s and I’ve googled around and tried dozens of things, but couldn’t find how to solve it.  
Thank you.

Ariel.

---

<div class="post-metadata">

**Author:** ![Sam2](https://avatars.discourse-cdn.com/v4/letter/s/9de0a6/32.png) [@Sam2](https://forum.ansible.com/u/Sam2)\
**Post date:** [June 23, 2021, 12:14pm UTC](https://forum.ansible.com/t/awx-operator-installation-error-on-awx-postgres-0/35056/2 "2021-06-23T12:14:18Z")

</div>

I got the same issue, have you been able to sort this out ?

---

<div class="post-metadata">

**Author:** ![Wei-Yen\_Tan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wei-yen_tan/32/4111_2.png) [@Wei-Yen\_Tan](https://forum.ansible.com/u/Wei-Yen_Tan)\
**Post date:** [June 23, 2021, 12:38pm UTC](https://forum.ansible.com/t/awx-operator-installation-error-on-awx-postgres-0/35056/3 "2021-06-23T12:38:18Z")

</div>

Yes. What’s happening is thst it can’t find storage for your pod.

In kubernetes a deployment will request for storage through a persistent volume claim otherwise called a pvc. You have to provide that storage with a persistrnt volume or a pv

---

<div class="post-metadata">

**Author:** ![Sam2](https://avatars.discourse-cdn.com/v4/letter/s/9de0a6/32.png) [@Sam2](https://forum.ansible.com/u/Sam2)\
**Post date:** [June 23, 2021, 1:15pm UTC](https://forum.ansible.com/t/awx-operator-installation-error-on-awx-postgres-0/35056/4 "2021-06-23T13:15:07Z")

</div>

Thanks for the hint, I am bit new to kubernetes, would you be able please to elaborate more about where/how to change this ?

---

<div class="post-metadata">

**Author:** ![Wei-Yen\_Tan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wei-yen_tan/32/4111_2.png) [@Wei-Yen\_Tan](https://forum.ansible.com/u/Wei-Yen_Tan)\
**Post date:** [June 23, 2021, 1:18pm UTC](https://forum.ansible.com/t/awx-operator-installation-error-on-awx-postgres-0/35056/5 "2021-06-23T13:18:02Z")

</div>

[https://kubernetes.io/docs/tasks/configure-pod-container/configure-persistent-volume-storage/](https://kubernetes.io/docs/tasks/configure-pod-container/configure-persistent-volume-storage/)

Create a persistent volume

---

<div class="post-metadata">

**Author:** ![Andrei\_Mihai](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/andrei_mihai/32/7257_2.png) [@Andrei\_Mihai](https://forum.ansible.com/u/Andrei_Mihai)\
**Post date:** [September 12, 2022, 9:25am UTC](https://forum.ansible.com/t/awx-operator-installation-error-on-awx-postgres-0/35056/6 "2022-09-12T09:25:12Z")

</div>

Hey,

I’ve followed all the guides and it seems like the postgress pod fails scheduling:

[sysadmin@dev-awx-01 k8awx]$ kubectl describe pod **-postgres-13-0  
Name: -postgres-13-0  
Namespace: awx  
Priority: 0  
Node:   
Labels: [app.kubernetes.io/component=database](http://app.kubernetes.io/component=database)  
 [app.kubernetes.io/instance=postgres-13-](http://app.kubernetes.io/instance=postgres-13-)  
 [app.kubernetes.io/managed-by=awx-operator](http://app.kubernetes.io/managed-by=awx-operator)  
 [app.kubernetes.io/name=postgres-13](http://app.kubernetes.io/name=postgres-13)  
 [app.kubernetes.io/part-of=](http://app.kubernetes.io/part-of=)**  
controller-revision-hash=**-postgres-13-8677ccdd5d  
 [statefulset.kubernetes.io/pod-name=](http://statefulset.kubernetes.io/pod-name=)**-postgres-13-0  
Annotations:   
Status: Pending  
IP:  
IPs:   
Controlled By: StatefulSet/**-postgres-13  
Containers:  
postgres:  
Image: postgres:13  
Port: 5432/TCP  
Host Port: 0/TCP  
Requests:  
cpu: 10m  
memory: 64Mi  
Environment:  
POSTGRESQL\_DATABASE: \<set to the key ‘database’ in secret '**-postgres-configuration’\> Optional: false  
POSTGRESQL\_USER: \<set to the key ‘username’ in secret ‘**-postgres-configuration’\> Optional: false  
POSTGRESQL\_PASSWORD: \<set to the key ‘password’ in secret '**-postgres-configuration’\> Optional: false  
POSTGRES\_DB: \<set to the key ‘database’ in secret ‘**-postgres-configuration’\> Optional: false  
POSTGRES\_USER: \<set to the key ‘username’ in secret '**-postgres-configuration’\> Optional: false  
POSTGRES\_PASSWORD: \<set to the key ‘password’ in secret '**-postgres-configuration’\> Optional: false  
PGDATA: /var/lib/postgresql/data/pgdata  
POSTGRES\_INITDB\_ARGS: --auth-host=scram-sha-256  
POSTGRES\_HOST\_AUTH\_METHOD: scram-sha-256  
Mounts:  
/var/lib/postgresql/data from postgres-13 (rw,path=“data”)  
/var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-glhch (ro)  
Conditions:  
Type Status  
PodScheduled False  
Volumes:  
postgres-13:  
Type: PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)  
ClaimName: postgres-13-**-postgres-13-0  
ReadOnly: false  
kube-api-access-glhch:  
Type: Projected (a volume that contains injected data from multiple sources)  
TokenExpirationSeconds: 3607  
ConfigMapName: kube-root-ca.crt  
ConfigMapOptional:   
DownwardAPI: true  
QoS Class: Burstable  
Node-Selectors:   
Tolerations: [node.kubernetes.io/not-ready:NoExecute](http://node.kubernetes.io/not-ready:NoExecute) op=Exists for 300s  
[node.kubernetes.io/unreachable:NoExecute](http://node.kubernetes.io/unreachable:NoExecute) op=Exists for 300s  
Events:  
Type Reason Age From Message

* * *

Warning FailedScheduling 9s (x2 over 96s) default-scheduler 0/1 nodes are available: 1 node(s) didn’t find available persistent volumes to bind.

I have two storage classes created. They are the same, except the bind mode. If I set the bind mode to Immediate, for the postgres SC, the postgres pod fails to scheduled with pod has unbound immediate PersistentVolumeClaims.  
The projects-storage will bind regardless of binding mode.

[sysadmin@dev-awx-01 k8awx]$ kubectl get sc  
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE  
postgres-storage [kubernetes.io/no-provisioner](http://kubernetes.io/no-provisioner) Delete WaitForFirstConsumer false 2m53s  
projects-storage [kubernetes.io/no-provisioner](http://kubernetes.io/no-provisioner) Delete Immediate false 2m53s

The PVs are the same. They are just named differently and point to their own storage class.

[sysadmin@dev-awx-01 k8awx]$ cat projects-storage-pv.yaml  
apiVersion: v1  
kind: PersistentVolume  
metadata:  
name: projects-storage-pv  
namespace: awx  
spec:  
accessModes:

- ReadWriteMany  
persistentVolumeReclaimPolicy: Retain  
capacity:  
storage: 20Gi  
volumeMode: Filesystem  
storageClassName: projects-storage  
local:  
path: /data/awx  
nodeAffinity:  
required:  
nodeSelectorTerms:
- matchExpressions:
- key: [kubernetes.io/hostname](http://kubernetes.io/hostname)  
operator: In  
values:
- dev-awx-0

[sysadmin@dev-awx-01 k8awx]$ cat postgres-pv.yaml  
apiVersion: v1  
kind: PersistentVolume  
metadata:  
name: postgres-storage-pv  
spec:  
accessModes:

- ReadWriteMany  
persistentVolumeReclaimPolicy: Retain  
capacity:  
storage: 20Gi  
volumeMode: Filesystem  
storageClassName: postgres-storage  
hostPath:  
path: /data/postgress  
nodeAffinity:  
required:  
nodeSelectorTerms:
- matchExpressions:
- key: [kubernetes.io/hostname](http://kubernetes.io/hostname)  
operator: In  
values:
- dev-awx-0

The PVs get created properly.

We are using local storage for this:  
[sysadmin@dev-awx-01 k8awx]$ df -h  
/dev/mapper/ansible-awx–storage 25G 211M 25G 1% /data/awx  
/dev/mapper/ansible-postgres–storage 25G 211M 25G 1% /data/postgress  
[sysadmin@dev-awx-01 k8awx]$

[sysadmin@dev-awx-01 k8awx]$ kubectl get pv  
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE  
postgres-storage-pv 20Gi RWX Retain Available postgres-storage 3m  
projects-storage-pv 20Gi RWX Retain Bound awx/projects-storage-pvc projects-storage 3m

However, the PVC for postgres-13-\*\*\*\*\*-postgres-13-0 will not bind.

[sysadmin@dev-awx-01 k8awx]$ kubectl get pvc  
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE  
postgres-13-\*\*\*\*\*-postgres-13-0 Pending postgres-storage 2m40s  
projects-storage-pvc Bound projects-storage-pv 20Gi RWX projects-storage 3m3s

Describing the PVC, shows it’s waiting for the POD to be scheduled.

[sysadmin@dev-awx-01 k8awx]$ kubectl describe pvc postgres-13-**-postgres-13-0  
Name: postgres-13-**-postgres-13-0  
Namespace: awx  
StorageClass: postgres-storage  
Status: Pending  
Volume:  
Labels: [app.kubernetes.io/component=database](http://app.kubernetes.io/component=database)  
[app.kubernetes.io/instance=postgres-13-\*\*\*\*](http://app.kubernetes.io/instance=postgres-13- **** )  
[app.kubernetes.io/managed-by=awx-operator](http://app.kubernetes.io/managed-by=awx-operator)  
[app.kubernetes.io/name=postgres-13](http://app.kubernetes.io/name=postgres-13)  
Annotations:   
Finalizers: [[kubernetes.io/pvc-protection](http://kubernetes.io/pvc-protection)]  
Capacity:  
Access Modes:  
VolumeMode: Filesystem  
Used By: \*\*\*\*-postgres-13-0  
Events:  
Type Reason Age From Message

* * *

Normal WaitForFirstConsumer 9m29s persistentvolume-controller waiting for first consumer to be created before binding  
Normal WaitForPodScheduled 3m25s (x25 over 9m25s) persistentvolume-controller waiting for pod \*\*\*\*-postgres-13-0 to be scheduled

Below is the awx yaml and the kustomization.yaml.
