2015-10-13 56 views
0

我按照這個例子來創建容量莢, https://github.com/kubernetes/kubernetes/blob/master/examples/cephfs/cephfs.yaml,我想對我來說有些不對。kubernetes莢容量使用cephfs

搬運工檢查:

「到/ mnt/cephfs」: 「/var/lib/kubelet/pods/7631bff0-7155-11e5-9e8a-000c29de7e43/volumes/kubernetes.io~empty-dir/cephfs」

和我的YAML是:

apiVersion: v1 
kind: Pod 
metadata: 
    name: cephfs 
spec: 
    containers: 
    - name: cephfs-rw 
    image: centosphpok 
    volumeMounts: 
    - mountPath: "/mnt/cephfs" 
     name: cephfs 
    volumes: 
    - name: cephfs 
    cephfs: 
     monitors: 
     - 10.0.0.206:6789 
     user: admin 
     secretFile: "/etc/ceph/admin.secret" 
     readOnly: true 
+0

你能在'在/ var /登錄您的節點上/ kubelet.log'看一下如果它在嘗試安裝音量時打印錯誤?如果您在pod中查看「/ etc/ceph/admin.secret」,它是否包含正確的信息以裝入卷? –

回答

0

有一件事你可以嘗試是同時使用secretFile屬性和創建Kubernetes 祕密對象使用爲好。

這是我PersistentVolume是什麼樣子:

kind: PersistentVolume 
apiVersion: v1 
metadata: 
    name: oracle 
    labels: 
    type: rbd 
spec: 
    capacity: 
    storage: 10Gi 
    accessModes: 
    - ReadWriteOnce 
    rbd: 
    pool: rbd 
    image: oracle 
    user: admin 
    keyring: "/etc/ceph/ceph.client.admin.keyring" 
    secretRef: 
     name: ceph-secret 
    fsType: ext4 
    readOnly: false 
    monitors: 
     - "23.23.23.48:6789" 
     - "23.23.23.51:6789" 
     - "23.23.23.56:6789" 

這是我的祕密:

apiVersion: v1 
kind: Secret 
metadata: 
    name: ceph-secret 
    data: 
     key: AQCChg1WULlLGRAAVB+ws+Uo5FslFPdy338KJg==