1

当我使用大量 cephfs 时它正在工作。路径是 /test 并且用户是 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

StorageClass但是当我创建这样的时它不起作用

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

我认为不支持参数 "path" ,如何将 path: /test 传输到StorageClassyaml?

4

1 回答 1

0

claimRoot,你可以看看这个例子中的用法。

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

另外,也许这篇文可能对您有所帮助。

于 2019-07-30T08:13:35.417 回答