[英]Mounting Rook Volumes in Google Kubernetes Engine (GKE)
我一直在研究Rook + Ceph的Kubernetes,試圖使其在Google Kubernetes Engine下工作,並且遇到了麻煩。
根據文檔,我運行了以下命令,並驗證了每個命令是否具有預期的效果:
kubectl create -f common.yaml
kubectl create -f operator.yaml
kubectl create -f cluster.yaml
kubectl create -f filesystem.yaml
yaml文件都是Rook提供的默認默認文件, operator.yaml
除外,其中我根據GKE docs添加了以下環境變量:
- name: FLEXVOLUME_DIR_PATH
value: "/home/kubernetes/flexvolume"
但是,我不確定從這里去哪里。 他們的文檔中有一個用於創建注冊表的示例文件,該文件導致了與我嘗試實現的目標無關的繁瑣指示。
本質上,我希望能夠將Ceph共享文件存儲作為卷從常規ol'容器映像掛載。 我嘗試了以下Yaml,但未成功:
apiVersion: v1
kind: Pod
metadata:
name: ubuntu
namespace: default
spec:
containers:
- name: ubuntu
image: ubuntu:bionic
command:
- sleep
- "3600"
imagePullPolicy: IfNotPresent
volumeMounts:
- name: image-store
mountPath: /mnt/shared
volumes:
- name: image-store
flexVolume:
driver: ceph.rook.io/rook
fsType: ceph
options:
fsName: myfs
clusterNamespace: rook-ceph
restartPolicy: Always
以我相當有限的知識,我看不出為什么這行不通,但是在執行kubectl describe pods ubuntu
時得到以下輸出:
Mounting command: systemd-run
Mounting arguments: --description=Kubernetes transient mount for /var/lib/kubelet/pods/10ee80d1-8873-11e9-8f45-42010a8a01d8/volumes/ceph.rook.io~rook/image-store --scope -- mount -t ceph -o name=admin,secret=AQDAM/lcQFKHARAAh/O27Wl+iRKRzREsMML+4g==,mds_namespace=myfs 10.8.3.134:6789,10.8.13.226:6789,10.8.5.39:6789:/ /var/lib/kubelet/pods/10ee80d1-8873-11e9-8f45-42010a8a01d8/volumes/ceph.rook.io~rook/image-store
Output: Running scope as unit: run-reb61186d1ff64e6e846a200580aa5395.scope
mount: /var/lib/kubelet/pods/10ee80d1-8873-11e9-8f45-42010a8a01d8/volumes/ceph.rook.io~rook/image-store: special device 10.8.3.134:6789,10.8.13.226:6789,10.8.5.39:6789:/ does not exist.
Warning FailedMount 51s (x2 over 2m53s) kubelet, gke-kubey-cluster-default-pool-6856b374-nb0c (combined from similar events): MountVolume.SetUp failed for volume "image-store" : mount command failed, status: Failure, reason: failed to mount filesystem myfs to /var/lib/kubelet/pods/10ee80d1-8873-11e9-8f45-42010a8a01d8/volumes/ceph.rook.io~rook/image-store with monitor 10.8.3.134:6789,10.8.13.226:6789,10.8.5.39:6789:/ and options [name=admin secret=AQDAM/lcQFKHARAAh/O27Wl+iRKRzREsMML+4g== mds_namespace=myfs]: mount failed: exit status 32
有沒有一個例子可以說明如何在野外某個地方實現這種目標?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.