2015-04-09 14:05:24 -04:00
<!-- BEGIN MUNGE: UNVERSIONED_WARNING -->
<!-- BEGIN STRIP_FOR_RELEASE -->
< img src = "http://kubernetes.io/img/warning.png" alt = "WARNING"
width="25" height="25">
< img src = "http://kubernetes.io/img/warning.png" alt = "WARNING"
width="25" height="25">
< img src = "http://kubernetes.io/img/warning.png" alt = "WARNING"
width="25" height="25">
< img src = "http://kubernetes.io/img/warning.png" alt = "WARNING"
width="25" height="25">
< img src = "http://kubernetes.io/img/warning.png" alt = "WARNING"
width="25" height="25">
< h2 > PLEASE NOTE: This document applies to the HEAD of the source tree< / h2 >
If you are using a released version of Kubernetes, you should
refer to the docs that go with that version.
2015-12-14 13:37:38 -05:00
<!-- TAG RELEASE_LINK, added by the munger automatically -->
2015-04-09 14:05:24 -04:00
< strong >
2015-11-03 13:17:57 -05:00
The latest release of this document can be found
[here ](http://releases.k8s.io/release-1.1/examples/cephfs/README.md ).
2015-04-09 14:05:24 -04:00
Documentation for other releases can be found at
[releases.k8s.io ](http://releases.k8s.io ).
< / strong >
--
<!-- END STRIP_FOR_RELEASE -->
<!-- END MUNGE: UNVERSIONED_WARNING -->
# How to Use it?
Install Ceph on the Kubernetes host. For example, on Fedora 21
# yum -y install ceph
If you don't have a Ceph cluster, you can set up a [containerized Ceph cluster ](https://github.com/rootfs/ceph_docker )
Then get the keyring from the Ceph cluster and copy it to */etc/ceph/keyring* .
2015-09-28 08:03:06 -04:00
Once you have installed Ceph and a Kubernetes cluster, you can create a pod based on my examples [cephfs.yaml ](cephfs.yaml ) and [cephfs-with-secret.yaml ](cephfs-with-secret.yaml ). In the pod yaml, you need to provide the following information.
2015-04-09 14:05:24 -04:00
- *monitors*: Array of Ceph monitors.
2016-02-01 16:01:19 -05:00
- *path*: Used as the mounted root, rather than the full Ceph tree. If not provided, default */* is used.
2015-04-09 14:05:24 -04:00
- *user*: The RADOS user name. If not provided, default *admin* is used.
- *secretFile*: The path to the keyring file. If not provided, default */etc/ceph/user.secret* is used.
- *secretRef*: Reference to Ceph authentication secrets. If provided, *secret* overrides *secretFile* .
- *readOnly*: Whether the filesystem is used as readOnly.
Here are the commands:
```console
2015-09-28 08:03:06 -04:00
# kubectl create -f examples/cephfs/cephfs.yaml
2015-04-09 14:05:24 -04:00
# create a secret if you want to use Ceph secret instead of secret file
2015-09-28 08:03:06 -04:00
# kubectl create -f examples/cephfs/secret/ceph-secret.yaml
2015-04-09 14:05:24 -04:00
2015-09-28 08:03:06 -04:00
# kubectl create -f examples/cephfs/cephfs-with-secret.yaml
# kubectl get pods
2015-04-09 14:05:24 -04:00
```
If you ssh to that machine, you can run `docker ps` to see the actual pod and `docker inspect` to see the volumes used by the container.
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[]()
<!-- END MUNGE: GENERATED_ANALYTICS -->