github.com/qsunny/k8s@v0.0.0-20220101153623-e6dca256d5bf/examples-master/volumes/cephfs/README.md (about) 1 # How to Use it? 2 3 Install Ceph on the Kubernetes host. For example, on Fedora 21 4 5 # yum -y install ceph 6 7 If you don't have a Ceph cluster, you can set up a [containerized Ceph cluster](https://github.com/ceph/ceph-docker/tree/master/examples/kubernetes) 8 9 Then get the keyring from the Ceph cluster and copy it to */etc/ceph/keyring*. 10 11 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. 12 13 - *monitors*: Array of Ceph monitors. 14 - *path*: Used as the mounted root, rather than the full Ceph tree. If not provided, default */* is used. 15 - *user*: The RADOS user name. If not provided, default *admin* is used. 16 - *secretFile*: The path to the keyring file. If not provided, default */etc/ceph/user.secret* is used. 17 - *secretRef*: Reference to Ceph authentication secrets. If provided, *secret* overrides *secretFile*. 18 - *readOnly*: Whether the filesystem is used as readOnly. 19 20 21 Here are the commands: 22 23 ```console 24 # kubectl create -f examples/volumes/cephfs/cephfs.yaml 25 26 # create a secret if you want to use Ceph secret instead of secret file 27 # kubectl create -f examples/volumes/cephfs/secret/ceph-secret.yaml 28 29 # kubectl create -f examples/volumes/cephfs/cephfs-with-secret.yaml 30 # kubectl get pods 31 ``` 32 33 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. 34 35 36 <!-- BEGIN MUNGE: GENERATED_ANALYTICS --> 37 []() 38 <!-- END MUNGE: GENERATED_ANALYTICS -->