Openshift 2.4 cdk Gitlab-CE“由于PersistentVolumeClaim未绑定,SchedulerPredicates失败:”gitlab-ce-redis-data“,这是出乎意料的。”

时间:2017-03-03 19:24:46

标签: openshift gitlab persistent-volumes persistent-volume-claims

在启动最新的cdk v 2.4(https://developers.redhat.com/products/cdk/download/)后,在尝试部署gitlab-ce时,按照gitlab在https://about.gitlab.com/2016/06/28/get-started-with-openshift-origin-3-and-gitlab/的指示

进行以下操作
Time    Kind and Name   Reason and Message
2:21:21 PM  
Pod
gitlab-ce-redis-1-1digf 
Failed scheduling  
*SchedulerPredicates failed due to PersistentVolumeClaim is not bound: "gitlab-ce-redis-data", which is unexpected.*
6 times in the last minute
2:21:20 PM  
Pod
gitlab-ce-1-89qc8   
Failed scheduling  
SchedulerPredicates failed due to PersistentVolumeClaim is not bound: "gitlab-ce-etc", which is unexpected.
6 times in the last minute
2:21:19 PM  
Pod
gitlab-ce-postgresql-1-yatd9    
Failed scheduling  
SchedulerPredicates failed due to PersistentVolumeClaim is not bound: "gitlab-ce-postgresql", which is unexpected.

他们似乎被创造并陷入“未决”状态:

NAME                   STATUS    VOLUME    CAPACITY   ACCESSMODES   AGE
gitlab-ce-data         Pending                                      5d
gitlab-ce-etc          Pending                                      5d
gitlab-ce-postgresql   Pending                                      5d
gitlab-ce-redis-data   Pending                                      5d

如何通过创建pv来解决这些错误?

1 个答案:

答案 0 :(得分:0)

PV需要由管理员用户创建,因此请以admin身份登录

oc login -u system:admin

如果master是远程主机,则可以为上一步使用令牌。然后创建PV:

$cat pv.yaml

kind: PersistentVolume
  metadata:
    name: foobar
  spec:
    capacity:
      storage: 5Gi
    accessModes:
      - ReadWriteMany
    persistentVolumeReclaimPolicy: Retain
    hostPath:
      path: /tmp/foo



oc create pv -f pv.yaml

您的RetainReadWriteMany5Gi值可能会有所不同。检查docs。 'hostPath'仅适用于单节点集群,否则您需要使用NFS或类似的。