Ceph Nautilus with step by step instruction to access existing CephFS cluster from Kubernetes pod

7/24/2019

The most recent Ceph "Nautilus" release claims Kubernetes support in CephFS (not via RDB). It is not clear how to configure Kubernetes (without Rook) to get access to my CephFS cluster just like I can access NFS storage.

What I did:

1.Installed the Ceph cluster 2. Used examples from ceph-csi and wasn't able to configure pvc. Looks like I missed some steps (how to install the Ceph provisioner is not clear?). It doesn't work out of the box for me.

I used code from "ceph-csi/deploy/cephfs/kubernetes/" folder taken from GitHub.

error on compilation "external-storage"

    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
-- Konstantin Pupkov
ceph
cephfs
kubernetes
provisioning

0 Answers