Merge pull request #14650 from linzichang/fixup-cephfs
Update cephfs example according to config best practices
This commit is contained in:
commit
fa49234b4e
|
@ -41,7 +41,7 @@ If you don't have a Ceph cluster, you can set up a [containerized Ceph cluster](
|
||||||
|
|
||||||
Then get the keyring from the Ceph cluster and copy it to */etc/ceph/keyring*.
|
Then get the keyring from the Ceph cluster and copy it to */etc/ceph/keyring*.
|
||||||
|
|
||||||
Once you have installed Ceph and new Kubernetes, you can create a pod based on my examples [cephfs.json](cephfs.json) and [cephfs-with-secret.json](cephfs-with-secret.json). In the pod JSON, you need to provide the following information.
|
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.
|
||||||
|
|
||||||
- *monitors*: Array of Ceph monitors.
|
- *monitors*: Array of Ceph monitors.
|
||||||
- *user*: The RADOS user name. If not provided, default *admin* is used.
|
- *user*: The RADOS user name. If not provided, default *admin* is used.
|
||||||
|
@ -53,11 +53,13 @@ Once you have installed Ceph and new Kubernetes, you can create a pod based on m
|
||||||
Here are the commands:
|
Here are the commands:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
# create a secret if you want to use Ceph secret instead of secret file
|
# kubectl create -f examples/cephfs/cephfs.yaml
|
||||||
# cluster/kubectl.sh create -f examples/cephfs/secret/ceph-secret.yaml
|
|
||||||
|
|
||||||
# cluster/kubectl.sh create -f examples/cephfs/v1beta3/cephfs.json
|
# create a secret if you want to use Ceph secret instead of secret file
|
||||||
# cluster/kubectl.sh get pods
|
# kubectl create -f examples/cephfs/secret/ceph-secret.yaml
|
||||||
|
|
||||||
|
# kubectl create -f examples/cephfs/cephfs-with-secret.yaml
|
||||||
|
# kubectl get pods
|
||||||
```
|
```
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
{
|
|
||||||
"apiVersion": "v1",
|
|
||||||
"id": "cephfs2",
|
|
||||||
"kind": "Pod",
|
|
||||||
"metadata": {
|
|
||||||
"name": "cephfs2"
|
|
||||||
},
|
|
||||||
"spec": {
|
|
||||||
"containers": [
|
|
||||||
{
|
|
||||||
"name": "cephfs-rw",
|
|
||||||
"image": "kubernetes/pause",
|
|
||||||
"volumeMounts": [
|
|
||||||
{
|
|
||||||
"mountPath": "/mnt/cephfs",
|
|
||||||
"name": "cephfs"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"volumes": [
|
|
||||||
{
|
|
||||||
"name": "cephfs",
|
|
||||||
"cephfs": {
|
|
||||||
"monitors": [
|
|
||||||
"10.16.154.78:6789",
|
|
||||||
"10.16.154.82:6789",
|
|
||||||
"10.16.154.83:6789"
|
|
||||||
],
|
|
||||||
"user": "admin",
|
|
||||||
"secretRef": {
|
|
||||||
"name": "ceph-secret"
|
|
||||||
},
|
|
||||||
"readOnly": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
|
metadata:
|
||||||
|
name: cephfs2
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: cephfs-rw
|
||||||
|
image: kubernetes/pause
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: "/mnt/cephfs"
|
||||||
|
name: cephfs
|
||||||
|
volumes:
|
||||||
|
- name: cephfs
|
||||||
|
cephfs:
|
||||||
|
monitors:
|
||||||
|
- 10.16.154.78:6789
|
||||||
|
- 10.16.154.82:6789
|
||||||
|
- 10.16.154.83:6789
|
||||||
|
user: admin
|
||||||
|
secretRef:
|
||||||
|
name: ceph-secret
|
||||||
|
readOnly: true
|
|
@ -1,37 +0,0 @@
|
||||||
{
|
|
||||||
"apiVersion": "v1",
|
|
||||||
"id": "cephfs",
|
|
||||||
"kind": "Pod",
|
|
||||||
"metadata": {
|
|
||||||
"name": "cephfs"
|
|
||||||
},
|
|
||||||
"spec": {
|
|
||||||
"containers": [
|
|
||||||
{
|
|
||||||
"name": "cephfs-rw",
|
|
||||||
"image": "kubernetes/pause",
|
|
||||||
"volumeMounts": [
|
|
||||||
{
|
|
||||||
"mountPath": "/mnt/cephfs",
|
|
||||||
"name": "cephfs"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"volumes": [
|
|
||||||
{
|
|
||||||
"name": "cephfs",
|
|
||||||
"cephfs": {
|
|
||||||
"monitors": [
|
|
||||||
"10.16.154.78:6789",
|
|
||||||
"10.16.154.82:6789",
|
|
||||||
"10.16.154.83:6789"
|
|
||||||
],
|
|
||||||
"user": "admin",
|
|
||||||
"secretFile": "/etc/ceph/admin.secret",
|
|
||||||
"readOnly": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
|
metadata:
|
||||||
|
name: cephfs
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: cephfs-rw
|
||||||
|
image: kubernetes/pause
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: "/mnt/cephfs"
|
||||||
|
name: cephfs
|
||||||
|
volumes:
|
||||||
|
- name: cephfs
|
||||||
|
cephfs:
|
||||||
|
monitors:
|
||||||
|
- 10.16.154.78:6789
|
||||||
|
- 10.16.154.82:6789
|
||||||
|
- 10.16.154.83:6789
|
||||||
|
user: admin
|
||||||
|
secretFile: "/etc/ceph/admin.secret"
|
||||||
|
readOnly: true
|
Loading…
Reference in New Issue