awx-db pod in pending mode

5/22/2019

I just wondering where shall I open this port. If you could just give me an idea would be great.

I am trying to add awx inside my kubernetes using this solution:

https://github.com/rossedman/ansible-awx-kubernetes

Facing the following problem:

NAME                         READY   STATUS    RESTARTS   AGE   IP            NODE              NOMINATED NODE   READINESS GATES
awx-cache-5c44475fcc-rfwvj   1/1     Running   0          41m   10.244.2.75   hs2-inf-v-ans07   <none>           <none>
awx-db-59789d55b9-tzlck      0/1     Pending   0          41m   <none>        <none>            <none>           <none>
awx-queue-7db5697f96-q46wk   1/1     Running   0          41m   10.244.2.76   hs2-inf-v-ans07   <none>           <none>
awx-task-69dfcc4d5f-qz7gx    1/1     Running   0          41m   10.244.2.77   hs2-inf-v-ans07   <none>           <none>
awx-web-5669b4f766-j95lq     1/1     Running   0          41m   10.244.2.78   hs2-inf-v-ans07   <none>           <none>
[root@hs2-inf-v-ans09 ~]#

Logs:

2019-05-22 23:18:23,835 INFO exited: daphne (exit status 1; not expected)
2019-05-22 23:18:24,838 INFO spawned: ‘daphne’ with pid 2019
2019-05-22 23:18:25,839 INFO success: daphne entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Traceback (most recent call last):
 File “/var/lib/awx/venv/awx/bin/daphne”, line 11, in <module>

File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/psycopg2/__init__.py”, line 130, in connect
   conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
django.db.utils.OperationalError: could not connect to server: Connection refused
       Is the server running on host “awx-db” (10.109.109.19) and accepting
       TCP/IP connections on port 5432?

My pod awx-db keeps in pending status its a kubernetes cluster of 3 nodes

[root@hs2-inf-v-ans09 ~]# kubectl describe pods awx-db-59789d55b9-tzlck
Name:               awx-db-59789d55b9-tzlck
Namespace:          default
Priority:           0
PriorityClassName:  <none>
Node:               <none>
Labels:             app=awx
                    pod-template-hash=59789d55b9
                    role=database
Annotations:        <none>
Status:             Pending
IP:                 
Controlled By:      ReplicaSet/awx-db-59789d55b9
Containers:
  postgres:
    Image:      postgres:9.6
    Port:       5432/TCP
    Host Port:  0/TCP
    Environment:
      POSTGRES_DB:        awx
      POSTGRES_PASSWORD:  awxpass
      POSTGRES_USER:      awx
      PGDATA:             /var/lib/postgresql/data/pgdata
    Mounts:
      /var/lib/postgresql/data from data-volume (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-2gqld (ro)
Conditions:
  Type           Status
  PodScheduled   False 
Volumes:
  data-volume:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  awx-db
    ReadOnly:   false
  default-token-2gqld:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-2gqld
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  <none>
Tolerations:     node.kubernetes.io/not-ready:NoExecute for 300s
                 node.kubernetes.io/unreachable:NoExecute for 300s
Events:
  Type     Reason            Age                  From               Message
  ----     ------            ----                 ----               -------
  Warning  FailedScheduling  2m1s (x50 over 72m)  default-scheduler  pod has unbound immediate PersistentVolumeClaims
[root@hs2-inf-v-ans09 ~]# 

Whats the best way to resolve it?

-- Scorpion83
ansible-awx
kubernetes

1 Answer

5/23/2019

You have an unbound immediate PersistentVolumeClaims as specified in the pod description. Creating a persistent volume of the appropriate class will fix the issue.

-- Alassane Ndiaye
Source: StackOverflow