0

在启动最新的 cdk v 2.4 ( https://developers.redhat.com/products/cdk/download/ ) 后,根据https://about.gitlab上的 gitlab 指示,我在尝试部署 gitlab-ce 时得到以下信息.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 时解决这些错误?

4

1 回答 1

0

PV 需要由 admin 用户创建,所以请以 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

在您的情况下Retain, , ReadWriteMany,5Gi值可能会有所不同。检查文档。'hostPath' 仅适用于单节点集群,否则需要使用 NFS 或类似的。

于 2017-03-07T11:30:10.427 回答