forked from virtuozzo/external-storage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Huamin Chen <[email protected]>
- Loading branch information
Showing
10 changed files
with
748 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright 2017 The Kubernetes Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
FROM centos:7 | ||
RUN rpm -Uvh https://download.ceph.com/rpm-jewel/el7/noarch/ceph-release-1-1.el7.noarch.rpm | ||
RUN yum install -y epel-release | ||
RUN yum install -y ceph-common python-cephfs | ||
ADD cephfs-provisioner /usr/local/bin/cephfs-provisioner | ||
ADD cephfs_provisioner/cephfs_provisioner.py /usr/local/bin/cephfs_provisioner | ||
CMD chmod x+o /usr/local/bin/cephfs_provisioner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# CephFS Volume Provisioner for Kubernetes 1.5+ | ||
|
||
Using Ceph volume client | ||
|
||
# Test instruction | ||
|
||
* Build cephfs-provisioner and container image | ||
|
||
```bash | ||
go build cephfs-provisioner.go | ||
docker build -t cephfs-provisioner . | ||
``` | ||
|
||
* Start Kubernetes local cluster | ||
|
||
* Create a Ceph admin secret | ||
|
||
```bash | ||
ceph auth get client.admin 2>&1 |grep "key = " |a^C '{print $3'} |xargs echo -n > /tmp/secret | ||
kubectl create secret generic ceph-secret-admin --from-file=/tmp/secret --namespace=kube-system | ||
``` | ||
|
||
* Start CephFS provisioner | ||
|
||
Assume kubeconfig is at `/root/.kube`: | ||
|
||
```bash | ||
docker run -ti -v /root/.kube:/kube --privileged --net=host cephfs-provisioner /usr/local/bin/cephfs-provisioner -master=http://127.0.0.1:8080 -kubeconfig=/kube/config | ||
``` | ||
|
||
* Create a CephFS Storage Class | ||
|
||
```bash | ||
kubectl create -f class.yaml | ||
``` | ||
|
||
* Create a claim | ||
|
||
```bash | ||
kubectl create -f claim.yaml | ||
``` | ||
|
||
* Create a Pod using the claim | ||
|
||
```bash | ||
kubectl create -f test-pod.yaml | ||
``` | ||
|
||
|
||
# Known limitations | ||
|
||
* Kernel CephFS doesn't work with SELinux, setting SELinux label in Pod's securityContext will not work. | ||
* Kernel CephFS doesn't support quota or capacity, capacity requested by PVC is not enforced or validated. | ||
* Currently each Ceph user created by the provisioner has `allow r` MDS cap to permit CephFS mount. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: ceph-secret-admin | ||
type: "kubernetes.io/cephfs" | ||
data: | ||
#Please note this value is base64 encoded. | ||
key: QVFDTXBIOVlNNFExQmhBQVhHTlF5eU9uZThac1hxV0dvbi9kSVE9PQ== |
Oops, something went wrong.