首页 > 解决方案 > awx-db pod 处于挂起模式

问题描述

我只是想知道我应该在哪里打开这个端口。如果你能给我一个想法就太好了。

我正在尝试使用此解决方案在我的 kubernetes 中添加 awx:

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

面临以下问题:

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 ~]#

日志:

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?

我的 pod awx-db 保持挂起状态,它是 3 个节点的 kubernetes 集群

[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 ~]# 

解决它的最佳方法是什么?

标签: kubernetesansible-awx

解决方案


unbound immediate PersistentVolumeClaims在 pod 描述中指定了一个。创建适当类的持久卷将解决此问题。


推荐阅读