最新的 Ceph “Nautilus” 版本声称 CephFS 支持 Kubernetes(不是通过 RDB)。目前尚不清楚如何配置 Kubernetes(没有 Rook)来访问我的 CephFS 集群,就像我可以访问 NFS 存储一样。
我做了什么:
1.安装了 Ceph 集群 2.使用了 ceph-csi 中的示例,无法配置 pvc。看起来我错过了一些步骤(不清楚如何安装 Ceph 配置器?)。它对我来说不是开箱即用的。
我使用了来自 GitHub 的“ceph-csi/deploy/cephfs/kubernetes/”文件夹中的代码。
编译“外部存储”时出错
kostya@kostya-ws:~/workspace/external-storage$ make
cd aws/efs; \
make container
make[1]: Entering directory '/home/kostya/workspace/external-storage/aws/efs'
docker build -t quay.io/external_storage/efs-provisioner:latest -f Dockerfile ../..
Sending build context to Docker daemon 57.97MB
Step 1/10 : FROM golang:1.11.1-alpine AS builder
---> 95ec94706ff6
Step 2/10 : ENV CGO_ENABLED=0
---> Using cache
---> d938b769a6f2
Step 3/10 : COPY vendor /go/src/github.com/kubernetes-incubator/external-storage/vendor
---> Using cache
---> 5b399a6c880f
Step 4/10 : COPY aws/efs /go/src/github.com/kubernetes-incubator/external-storage/aws/efs
---> Using cache
---> 6064356d3fd2
Step 5/10 : WORKDIR /go/src/github.com/kubernetes-incubator/external-storage/aws/efs
---> Using cache
---> e371476850c9
Step 6/10 : RUN go install ./cmd/efs-provisioner
---> Using cache
---> 84baa019ef76
Step 7/10 : FROM alpine:3.6
---> 43773d1dba76
Step 8/10 : RUN apk add --no-cache ca-certificates
---> Using cache
---> a324d62429a2
Step 9/10 : COPY --from=builder /go/bin/efs-provisioner /
---> Using cache
---> 6e1658c6dcd7
Step 10/10 : ENTRYPOINT ["/efs-provisioner"]
---> Using cache
---> f39741224126
Successfully built f39741224126
Successfully tagged quay.io/external_storage/efs-provisioner:latest
docker tag quay.io/external_storage/efs-provisioner:latest quay.io/external_storage/efs-provisioner:latest
make[1]: Leaving directory '/home/kostya/workspace/external-storage/aws/efs'
cd ceph/cephfs; \
make container
make[1]: Entering directory '/home/kostya/workspace/external-storage/ceph/cephfs'
CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -o cephfs-provisioner cephfs-provisioner.go
cephfs-provisioner.go:30:2: cannot find package "github.com/kubernetes-sigs/sig-storage-lib-external-provisioner/controller" in any of:
/usr/local/go/src/github.com/kubernetes-sigs/sig-storage-lib-external-provisioner/controller (from $GOROOT)
/home/kostya/go/src/github.com/kubernetes-sigs/sig-storage-lib-external-provisioner/controller (from $GOPATH)
cephfs-provisioner.go:31:2: cannot find package "github.com/kubernetes-sigs/sig-storage-lib-external-provisioner/util" in any of:
/usr/local/go/src/github.com/kubernetes-sigs/sig-storage-lib-external-provisioner/util (from $GOROOT)
/home/kostya/go/src/github.com/kubernetes-sigs/sig-storage-lib-external-provisioner/util (from $GOPATH)
cephfs-provisioner.go:32:2: cannot find package "k8s.io/api/core/v1" in any of:
/usr/local/go/src/k8s.io/api/core/v1 (from $GOROOT)
/home/kostya/go/src/k8s.io/api/core/v1 (from $GOPATH)
cephfs-provisioner.go:33:2: cannot find package "k8s.io/apimachinery/pkg/apis/meta/v1" in any of:
/usr/local/go/src/k8s.io/apimachinery/pkg/apis/meta/v1 (from $GOROOT)
/home/kostya/go/src/k8s.io/apimachinery/pkg/apis/meta/v1 (from $GOPATH)
cephfs-provisioner.go:34:2: cannot find package "k8s.io/apimachinery/pkg/util/uuid" in any of:
/usr/local/go/src/k8s.io/apimachinery/pkg/util/uuid (from $GOROOT)
/home/kostya/go/src/k8s.io/apimachinery/pkg/util/uuid (from $GOPATH)
cephfs-provisioner.go:35:2: cannot find package "k8s.io/apimachinery/pkg/util/wait" in any of:
/usr/local/go/src/k8s.io/apimachinery/pkg/util/wait (from $GOROOT)
/home/kostya/go/src/k8s.io/apimachinery/pkg/util/wait (from $GOPATH)
cephfs-provisioner.go:36:2: cannot find package "k8s.io/client-go/kubernetes" in any of:
/usr/local/go/src/k8s.io/client-go/kubernetes (from $GOROOT)
/home/kostya/go/src/k8s.io/client-go/kubernetes (from $GOPATH)
cephfs-provisioner.go:37:2: cannot find package "k8s.io/client-go/rest" in any of:
/usr/local/go/src/k8s.io/client-go/rest (from $GOROOT)
/home/kostya/go/src/k8s.io/client-go/rest (from $GOPATH)
cephfs-provisioner.go:38:2: cannot find package "k8s.io/client-go/tools/clientcmd" in any of:
/usr/local/go/src/k8s.io/client-go/tools/clientcmd (from $GOROOT)
/home/kostya/go/src/k8s.io/client-go/tools/clientcmd (from $GOPATH)
cephfs-provisioner.go:39:2: cannot find package "k8s.io/klog" in any of:
/usr/local/go/src/k8s.io/klog (from $GOROOT)
/home/kostya/go/src/k8s.io/klog (from $GOPATH)
make[1]: *** [Makefile:27: build] Error 1
make[1]: Leaving directory '/home/kostya/workspace/external-storage/ceph/cephfs'
make: *** [Makefile:45: ceph/cephfs] Error 2