It's working when I use volumes of cephfs . path is /test and user is test
apiVersion: v1
kind: Pod
metadata:
name: cephfs
spec:
containers:
- name: cephfs
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
path: /test
user: test
secretRef:
name: ceph-test
readOnly: true
but it's not working when I create a StorageClass
like this
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: cephfs
provisioner: ceph.com/cephfs
parameters:
monitors: 10.16.154.78:6789,10.16.154.82:6789,10.16.154.73:6789
adminId: test
adminSecretName: ceph-test
adminSecretNamespace: default
I think there is no support of parameters "path" , how can I transmit path: /test to the StorageClass
yaml?
There is claimRoot
, you can see the usage in this example.
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: cephfs
provisioner: ceph.com/cephfs
parameters:
monitors: 172.24.0.6:6789
adminId: admin
adminSecretName: ceph-secret-admin
adminSecretNamespace: "kube-system"
claimRoot: /pvc-volumes
Also maybe this blog post might be of help to you.