仲卿 發表於 2020-6-8 17:31:00

kubernetes使用ceph存储

<h3 class="md-end-block md-heading md-focus"><span class="md-plain md-expand">PV、PVC概述</span></h3>
<p class="md-end-block md-p"><span class="md-plain md-expand">管理存储是管理计算的一个明显问题。PersistentVolume子系统为用户和管理员提供了一个API,用于抽象如何根据消费方式提供存储的详细信息。于是引入了两个新的API资源:PersistentVolume和PersistentVolumeClaim</span></p>
<blockquote>
<p class="md-end-block md-p"><span class="md-plain">PersistentVolume(PV)是集群中已由管理员配置的一段网络存储。 集群中的资源就像一个节点是一个集群资源。 PV是诸如卷之类的卷插件,但是具有独立于使用PV的任何单个pod的生命周期。 该API对象包含存储的实现细节,即NFS,iSCSI或云提供商特定的存储系统。 </span></p>
</blockquote>
<blockquote>
<p class="md-end-block md-p"><span class="md-plain">PersistentVolumeClaim(PVC)是用户存储的请求。 它类似于pod。Pod消耗节点资源,PVC消耗存储资源。 pod可以请求特定级别的资源(CPU和内存)。 权限要求可以请求特定的大小和访问模式。</span></p>
</blockquote>
<blockquote>
<p class="md-end-block md-p"><span class="md-plain">虽然PersistentVolumeClaims允许用户使用抽象存储资源,但是常见的是,用户需要具有不同属性(如性能)的PersistentVolumes,用于不同的问题。 管理员需要能够提供多种不同于PersistentVolumes,而不仅仅是大小和访问模式,而不会使用户了解这些卷的实现细节。 对于这些需求,存在StorageClass资源。</span></p>
</blockquote>
<blockquote>
<p class="md-end-block md-p md-focus"><span class="md-plain md-expand">StorageClass为集群提供了一种描述他们提供的存储的“类”的方法。 不同的类可能映射到服务质量级别,或备份策略,或者由群集管理员确定的任意策略。 Kubernetes本身对于什么类别代表是不言而喻的。 这个概念有时在其他存储系统中称为“配置文件”</span></p>
</blockquote>
<h5 class="md-end-block md-heading md-focus"><span class="md-plain md-expand">POD动态供给</span></h5>
<blockquote>
<p class="md-end-block md-p"><span class="md-plain md-expand">动态供给主要是能够自动帮你创建pv,需要多大的空间就创建多大的pv。k8s帮助创建pv,创建pvc就直接api调用存储类来寻找pv。</span></p>
</blockquote>
<blockquote>
<p class="md-end-block md-p"><span class="md-plain">如果是存储静态供给的话,会需要我们手动去创建pv,如果没有足够的资源,找不到合适的pv,那么pod就会处于pending等待的状态。而动态供给主要的一个实现就是StorageClass存储对象,其实它就是声明你使用哪个存储,然后帮你去连接,再帮你去自动创建pv。</span></p>
</blockquote>
<h5 class="md-end-block md-heading md-focus"><span class="md-plain md-expand">POD使用RBD做为持久数据卷</span></h5>
<h6><span class="md-plain md-expand">安装与配置</span></h6>
<p><span class="md-plain md-expand"><span class="md-plain md-expand">RBD支持ReadWriteOnce,ReadOnlyMany两种模式</span></span></p>
<p>1、配置rbd-provisioner</p>
<p>github仓库链接https://github.com/kubernetes-incubator/external-storage</p>
<div class="cnblogs_code">
<pre># git clone https:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">github.com/kubernetes-incubator/external-storage.git</span>
# cd external-storage/ceph/rbd/<span style="color: rgba(0, 0, 0, 1)">deploy
# NAMESPACE</span>=kube-<span style="color: rgba(0, 0, 0, 1)">system
# </span><span style="color: rgba(0, 0, 255, 1)">sed</span> -r -i <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">s/namespace: [^ ]+/namespace: $NAMESPACE/g</span><span style="color: rgba(128, 0, 0, 1)">"</span> ./rbac/clusterrolebinding.yaml ./rbac/<span style="color: rgba(0, 0, 0, 1)">rolebinding.yaml
# kubectl </span>-n $NAMESPACE apply -f ./<span style="color: rgba(0, 0, 0, 1)">rbac

# kubectl get pod </span>-n kube-<span style="color: rgba(0, 0, 0, 1)">system
NAME                               READY   STATUS    RESTARTS   AGE
coredns</span>-575bd6d498-n995v         <span style="color: rgba(128, 0, 128, 1)">1</span>/<span style="color: rgba(128, 0, 128, 1)">1</span>   Running   <span style="color: rgba(128, 0, 128, 1)">1</span><span style="color: rgba(0, 0, 0, 1)">          13d
kube</span>-flannel-ds-amd64-gplmm      <span style="color: rgba(128, 0, 128, 1)">1</span>/<span style="color: rgba(128, 0, 128, 1)">1</span>   Running   <span style="color: rgba(128, 0, 128, 1)">1</span><span style="color: rgba(0, 0, 0, 1)">          13d
kube</span>-flannel-ds-amd64-jrrb9      <span style="color: rgba(128, 0, 128, 1)">1</span>/<span style="color: rgba(128, 0, 128, 1)">1</span>   Running   <span style="color: rgba(128, 0, 128, 1)">1</span><span style="color: rgba(0, 0, 0, 1)">          13d
kube</span>-flannel-ds-amd64-ttcx4      <span style="color: rgba(128, 0, 128, 1)">1</span>/<span style="color: rgba(128, 0, 128, 1)">1</span>   Running   <span style="color: rgba(128, 0, 128, 1)">1</span><span style="color: rgba(0, 0, 0, 1)">          13d
rbd</span>-provisioner-75b85f85bd-vr7t5   <span style="color: rgba(128, 0, 128, 1)">1</span>/<span style="color: rgba(128, 0, 128, 1)">1</span>   Running   <span style="color: rgba(128, 0, 128, 1)">0</span>          72s</pre>
</div>
<p>2、配置k8s访问ceph的用户</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(128, 0, 128, 1)">1</span>、创建pod时,kubelet需要使用rbd命令去检测和挂载pv对应的ceph image,所以要在所有的worker节点安装ceph客户端ceph-<span style="color: rgba(0, 0, 0, 1)">common。
将ceph的ceph.client.admin.keyring和ceph.conf文件拷贝到master的</span>/etc/<span style="color: rgba(0, 0, 0, 1)">ceph目录下
</span><span style="color: rgba(0, 0, 255, 1)">yum</span> -y <span style="color: rgba(0, 0, 255, 1)">install</span> ceph-<span style="color: rgba(0, 0, 0, 1)">common
</span><span style="color: rgba(128, 0, 128, 1)">2</span><span style="color: rgba(0, 0, 0, 1)">、创建 osd pool 在ceph的mon或者admin节点
ceph osd pool create kube </span><span style="color: rgba(128, 0, 128, 1)">128</span> <span style="color: rgba(128, 0, 128, 1)">128</span><span style="color: rgba(0, 0, 0, 1)">
ceph osd pool </span><span style="color: rgba(0, 0, 255, 1)">ls</span>
<span style="color: rgba(128, 0, 128, 1)">3</span><span style="color: rgba(0, 0, 0, 1)">、创建k8s访问ceph的用户 在ceph的mon或者admin节点
ceph auth get</span>-or-create client.kube mon <span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(128, 0, 0, 1)">allow r</span><span style="color: rgba(128, 0, 0, 1)">'</span> osd <span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(128, 0, 0, 1)">allow class-read object_prefix rbd_children, allow rwx pool=kube</span><span style="color: rgba(128, 0, 0, 1)">'</span> -<span style="color: rgba(0, 0, 0, 1)">o ceph.client.kube.keyring
</span><span style="color: rgba(128, 0, 128, 1)">4</span><span style="color: rgba(0, 0, 0, 1)">、查看key 在ceph的mon或者admin节点
# ceph auth get-<span style="color: rgba(0, 0, 0, 1)">key client.admin
AQCBrJ9eV</span>/U5NBAAoDlM4gV3a+KNQDBOUqVxdw==<span style="color: rgba(0, 0, 0, 1)">
# ceph auth get-<span style="color: rgba(0, 0, 0, 1)">key client.kube
AQCZ96BeUgPkDhAAhxbWarZh9kTx2QbFCDM</span>/rA==

<span style="color: rgba(128, 0, 128, 1)">5</span><span style="color: rgba(0, 0, 0, 1)">、创建 admin secret
kubectl create secret generic ceph</span>-secret --type=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">kubernetes.io/rbd</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)"> \
</span>--from-literal=key=AQCBrJ9eV/U5NBAAoDlM4gV3a+KNQDBOUqVxdw==<span style="color: rgba(0, 0, 0, 1)"> \
</span>--namespace=kube-<span style="color: rgba(0, 0, 0, 1)">system
# kubectl get secret </span>-n kube-system |<span style="color: rgba(0, 0, 255, 1)">grep</span><span style="color: rgba(0, 0, 0, 1)"> ceph
ceph</span>-secret                   kubernetes.io/rbd                     <span style="color: rgba(128, 0, 128, 1)">1</span><span style="color: rgba(0, 0, 0, 1)">      91s
</span><span style="color: rgba(128, 0, 128, 1)">6</span><span style="color: rgba(0, 0, 0, 1)">、在 default 命名空间创建pvc用于访问ceph的 secret
kubectl create secret generic ceph</span>-user-secret --type=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">kubernetes.io/rbd</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)"> \
</span>--from-literal=key=AQCZ96BeUgPkDhAAhxbWarZh9kTx2QbFCDM/rA==<span style="color: rgba(0, 0, 0, 1)"> \
</span>--namespace=<span style="color: rgba(0, 0, 0, 1)">default
# kubectl get secret
NAME                  TYPE                                  DATA   AGE
ceph</span>-user-secret      kubernetes.io/rbd                     <span style="color: rgba(128, 0, 128, 1)">1</span>      114s</pre>
</div>
<p>3、配置StorageClass</p>
<div class="cnblogs_code">
<pre># vim storageclass-ceph-<span style="color: rgba(0, 0, 0, 1)">rdb.yaml
kind: StorageClass
apiVersion: storage.k8s.io</span>/<span style="color: rgba(0, 0, 0, 1)">v1
metadata:
name: dynamic</span>-ceph-<span style="color: rgba(0, 0, 0, 1)">rdb
provisioner: ceph.com</span>/<span style="color: rgba(0, 0, 0, 1)">rbd
parameters:
monitors: </span><span style="color: rgba(128, 0, 128, 1)">192.168</span>.<span style="color: rgba(128, 0, 128, 1)">0.246</span>:<span style="color: rgba(128, 0, 128, 1)">6789</span>,<span style="color: rgba(128, 0, 128, 1)">192.168</span>.<span style="color: rgba(128, 0, 128, 1)">0.247</span>:<span style="color: rgba(128, 0, 128, 1)">6789</span>,<span style="color: rgba(128, 0, 128, 1)">192.168</span>.<span style="color: rgba(128, 0, 128, 1)">0.248</span>:<span style="color: rgba(128, 0, 128, 1)">6789</span><span style="color: rgba(0, 0, 0, 1)">
adminId: admin
adminSecretName: ceph</span>-<span style="color: rgba(0, 0, 0, 1)">secret
adminSecretNamespace: kube</span>-<span style="color: rgba(0, 0, 0, 1)">system
pool: kube
userId: kube
userSecretName: ceph</span>-user-<span style="color: rgba(0, 0, 0, 1)">secret
fsType: ext4
imageFormat: </span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">2</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
imageFeatures: </span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">layering</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">

# kubectl apply -f storageclass-ceph-<span style="color: rgba(0, 0, 0, 1)">rdb.yaml
storageclass.storage.k8s.io</span>/dynamic-ceph-<span style="color: rgba(0, 0, 0, 1)">rdb created
# kubectl get sc
NAME               PROVISIONER    RECLAIMPOLICY   VOLUMEBINDINGMODE   ALLOWVOLUMEEXPANSION   AGE
dynamic</span>-ceph-rdb   ceph.com/rbd   Delete          Immediate         <span style="color: rgba(0, 0, 255, 1)">false</span>                  12s</pre>
</div>
<p>创建 pvc测试</p>
<div class="cnblogs_code">
<pre># <span style="color: rgba(0, 0, 255, 1)">cat</span> &gt;ceph-rdb-pvc-test.yaml&lt;&lt;<span style="color: rgba(0, 0, 0, 1)">EOF
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: ceph</span>-rdb-<span style="color: rgba(0, 0, 0, 1)">claim
spec:
accessModes:   
    </span>-<span style="color: rgba(0, 0, 0, 1)"> ReadWriteOnce
storageClassName: dynamic</span>-ceph-<span style="color: rgba(0, 0, 0, 1)">rdb
resources:
    requests:
      storage: 2Gi
EOF
# kubectl apply </span>-f ceph-rdb-pvc-<span style="color: rgba(0, 0, 0, 1)">test.yaml
# kubectl get pv,pvc
NAME                                                      CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM                  STORAGECLASS       REASON   AGE
persistentvolume</span>/pvc-908ec99d-<span style="color: rgba(128, 0, 128, 1)">5029</span>-4c62-952f-016ca11ab08c   2Gi      RWO            Delete         Bound    default/ceph-rdb-claim   dynamic-ceph-<span style="color: rgba(0, 0, 0, 1)">rdb            8s

NAME                                 STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS       AGE
persistentvolumeclaim</span>/ceph-rdb-claim   Bound    pvc-908ec99d-<span style="color: rgba(128, 0, 128, 1)">5029</span>-4c62-952f-016ca11ab08c   2Gi      RWO            dynamic-ceph-rdb   9s</pre>
</div>
<p>创建 nginx pod 挂载测试</p>
<div class="cnblogs_code">
<pre># <span style="color: rgba(0, 0, 255, 1)">cat</span> &gt;nginx-pod.yaml&lt;&lt;<span style="color: rgba(0, 0, 0, 1)">EOF
apiVersion: v1
kind: Pod
metadata:
name: nginx</span>-<span style="color: rgba(0, 0, 0, 1)">pod1
labels:
    name: nginx</span>-<span style="color: rgba(0, 0, 0, 1)">pod1
spec:
containers:
</span>- name: nginx-<span style="color: rgba(0, 0, 0, 1)">pod1
    image: nginx:alpine
    ports:
    </span>-<span style="color: rgba(0, 0, 0, 1)"> name: web
      containerPort: </span><span style="color: rgba(128, 0, 128, 1)">80</span><span style="color: rgba(0, 0, 0, 1)">
    volumeMounts:
    </span>- name: ceph-<span style="color: rgba(0, 0, 0, 1)">rdb
      mountPath: </span>/usr/share/nginx/<span style="color: rgba(0, 0, 0, 1)">html
volumes:
</span>- name: ceph-<span style="color: rgba(0, 0, 0, 1)">rdb
    persistentVolumeClaim:
      claimName: ceph</span>-rdb-<span style="color: rgba(0, 0, 0, 1)">claim
EOF
# kubectl apply </span>-f nginx-<span style="color: rgba(0, 0, 0, 1)">pod.yaml

# kubectl get pod -<span style="color: rgba(0, 0, 0, 1)">o wide
NAME         READY   STATUS    RESTARTS   AGE   IP         NODE          NOMINATED NODE   READINESS GATES
nginx</span>-pod1   <span style="color: rgba(128, 0, 128, 1)">1</span>/<span style="color: rgba(128, 0, 128, 1)">1</span>   Running   <span style="color: rgba(128, 0, 128, 1)">0</span>          43s   <span style="color: rgba(128, 0, 128, 1)">10.244</span>.<span style="color: rgba(128, 0, 128, 1)">2.3</span>   k8s-master1   &lt;none&gt;         &lt;none&gt;<span style="color: rgba(0, 0, 0, 1)">
# kubectl exec -ti nginx-pod1 -- /bin/<span style="color: rgba(0, 0, 255, 1)">sh</span> -c <span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(128, 0, 0, 1)">echo this is from Ceph RBD!!! &gt; /usr/share/nginx/html/index.html</span><span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(0, 0, 0, 1)">
# curl <span style="color: rgba(128, 0, 128, 1)">10.244</span>.<span style="color: rgba(128, 0, 128, 1)">2.3</span><span style="color: rgba(0, 0, 0, 1)">
this is from Ceph RBD</span>!!!</pre>
</div>
<p>清理</p>
<div class="cnblogs_code">
<pre>kubectl delete -f nginx-<span style="color: rgba(0, 0, 0, 1)">pod.yaml
kubectl delete </span>-f ceph-rdb-pvc-test.yaml</pre>
</div>
<h3 class="md-end-block md-heading md-focus"><span class="md-plain md-expand">POD使用CephFS做为持久数据卷</span></h3>
<p>CephFS方式支持k8s的pv的3种访问模式ReadWriteOnce,ReadOnlyMany ,ReadWriteMany</p>
<h5 class="md-end-block md-heading md-focus"><span class="md-plain md-expand">Ceph端创建CephFS pool</span></h5>
<p><span class="md-plain md-expand"><span class="md-plain md-expand">1、如下操作在ceph的mon或者admin节点<span class="md-softbreak"> <span class="md-plain md-expand">CephFS需要使用两个Pool来分别存储数据和元数据</span></span></span></span></p>
<div class="cnblogs_code">
<pre><span style="color: rgba(128, 0, 128, 1)">1</span><span style="color: rgba(0, 0, 0, 1)">、如下操作在ceph的mon或者admin节点CephFS需要使用两个Pool来分别存储数据和元数据
ceph osd pool create fs_data </span><span style="color: rgba(128, 0, 128, 1)">128</span><span style="color: rgba(0, 0, 0, 1)">
ceph osd pool create fs_metadata </span><span style="color: rgba(128, 0, 128, 1)">128</span><span style="color: rgba(0, 0, 0, 1)">
ceph osd lspools

</span><span style="color: rgba(128, 0, 128, 1)">2</span><span style="color: rgba(0, 0, 0, 1)">、创建一个CephFS
ceph fs new cephfs fs_metadata fs_data

</span><span style="color: rgba(128, 0, 128, 1)">3</span><span style="color: rgba(0, 0, 0, 1)">、查看
# ceph fs </span><span style="color: rgba(0, 0, 255, 1)">ls</span><span style="color: rgba(0, 0, 0, 1)">
name: cephfs, metadata pool: fs_metadata, data pools: </span></pre>
</div>
<h5 class="md-end-block md-heading md-focus"><span class="md-plain md-expand">部署 cephfs-provisioner</span></h5>
<p><span class="md-plain md-expand"><span class="md-plain md-expand"><span class="md-softbreak"><span class="md-plain md-expand">使用社区提供的cephfs-provisioner</span></span></span></span></p>
<div class="cnblogs_code">
<pre># <span style="color: rgba(0, 0, 255, 1)">cat</span> &gt;external-storage-cephfs-provisioner.yaml&lt;&lt;<span style="color: rgba(0, 0, 0, 1)">EOF
apiVersion: v1
kind: Namespace
metadata:
   name: cephfs
   labels:
   name: cephfs

</span>---<span style="color: rgba(0, 0, 0, 1)">
apiVersion: v1
kind: ServiceAccount
metadata:
name: cephfs</span>-<span style="color: rgba(0, 0, 0, 1)">provisioner
namespace: kube</span>-<span style="color: rgba(0, 0, 0, 1)">system

</span>---<span style="color: rgba(0, 0, 0, 1)">
apiVersion: rbac.authorization.k8s.io</span>/<span style="color: rgba(0, 0, 0, 1)">v1
kind: Role
metadata:
name: cephfs</span>-<span style="color: rgba(0, 0, 0, 1)">provisioner
namespace: kube</span>-<span style="color: rgba(0, 0, 0, 1)">system
rules:
</span>- apiGroups: [<span style="color: rgba(128, 0, 0, 1)">""</span><span style="color: rgba(0, 0, 0, 1)">]
    resources: [</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">secrets</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">]
    verbs: [</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">create</span><span style="color: rgba(128, 0, 0, 1)">"</span>, <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">get</span><span style="color: rgba(128, 0, 0, 1)">"</span>, <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">delete</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">]
</span>- apiGroups: [<span style="color: rgba(128, 0, 0, 1)">""</span><span style="color: rgba(0, 0, 0, 1)">]
    resources: [</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">endpoints</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">]
    verbs: [</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">get</span><span style="color: rgba(128, 0, 0, 1)">"</span>, <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">list</span><span style="color: rgba(128, 0, 0, 1)">"</span>, <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">watch</span><span style="color: rgba(128, 0, 0, 1)">"</span>, <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">create</span><span style="color: rgba(128, 0, 0, 1)">"</span>, <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">update</span><span style="color: rgba(128, 0, 0, 1)">"</span>, <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">patch</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">]

</span>---<span style="color: rgba(0, 0, 0, 1)">
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io</span>/<span style="color: rgba(0, 0, 0, 1)">v1
metadata:
name: cephfs</span>-<span style="color: rgba(0, 0, 0, 1)">provisioner
namespace: kube</span>-<span style="color: rgba(0, 0, 0, 1)">system
rules:
</span>- apiGroups: [<span style="color: rgba(128, 0, 0, 1)">""</span><span style="color: rgba(0, 0, 0, 1)">]
    resources: [</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">persistentvolumes</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">]
    verbs: [</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">get</span><span style="color: rgba(128, 0, 0, 1)">"</span>, <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">list</span><span style="color: rgba(128, 0, 0, 1)">"</span>, <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">watch</span><span style="color: rgba(128, 0, 0, 1)">"</span>, <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">create</span><span style="color: rgba(128, 0, 0, 1)">"</span>, <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">delete</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">]
</span>- apiGroups: [<span style="color: rgba(128, 0, 0, 1)">""</span><span style="color: rgba(0, 0, 0, 1)">]
    resources: [</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">persistentvolumeclaims</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">]
    verbs: [</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">get</span><span style="color: rgba(128, 0, 0, 1)">"</span>, <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">list</span><span style="color: rgba(128, 0, 0, 1)">"</span>, <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">watch</span><span style="color: rgba(128, 0, 0, 1)">"</span>, <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">update</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">]
</span>- apiGroups: [<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">storage.k8s.io</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">]
    resources: [</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">storageclasses</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">]
    verbs: [</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">get</span><span style="color: rgba(128, 0, 0, 1)">"</span>, <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">list</span><span style="color: rgba(128, 0, 0, 1)">"</span>, <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">watch</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">]
</span>- apiGroups: [<span style="color: rgba(128, 0, 0, 1)">""</span><span style="color: rgba(0, 0, 0, 1)">]
    resources: [</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">events</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">]
    verbs: [</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">create</span><span style="color: rgba(128, 0, 0, 1)">"</span>, <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">update</span><span style="color: rgba(128, 0, 0, 1)">"</span>, <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">patch</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">]
</span>- apiGroups: [<span style="color: rgba(128, 0, 0, 1)">""</span><span style="color: rgba(0, 0, 0, 1)">]
    resources: [</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">services</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">]
    resourceNames: [</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">kube-dns</span><span style="color: rgba(128, 0, 0, 1)">"</span>,<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">coredns</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">]
    verbs: [</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">list</span><span style="color: rgba(128, 0, 0, 1)">"</span>, <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">get</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">]
</span>- apiGroups: [<span style="color: rgba(128, 0, 0, 1)">""</span><span style="color: rgba(0, 0, 0, 1)">]
    resources: [</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">secrets</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">]
    verbs: [</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">get</span><span style="color: rgba(128, 0, 0, 1)">"</span>, <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">create</span><span style="color: rgba(128, 0, 0, 1)">"</span>, <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">delete</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">]
</span>- apiGroups: [<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">policy</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">]
    resourceNames: [</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">cephfs-provisioner</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">]
    resources: [</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">podsecuritypolicies</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">]
    verbs: [</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">use</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">]

</span>---<span style="color: rgba(0, 0, 0, 1)">
apiVersion: rbac.authorization.k8s.io</span>/<span style="color: rgba(0, 0, 0, 1)">v1
kind: RoleBinding
metadata:
name: cephfs</span>-<span style="color: rgba(0, 0, 0, 1)">provisioner
namespace: kube</span>-<span style="color: rgba(0, 0, 0, 1)">system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: cephfs</span>-<span style="color: rgba(0, 0, 0, 1)">provisioner
subjects:
</span>-<span style="color: rgba(0, 0, 0, 1)"> kind: ServiceAccount
name: cephfs</span>-<span style="color: rgba(0, 0, 0, 1)">provisioner

</span>---<span style="color: rgba(0, 0, 0, 1)">
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io</span>/<span style="color: rgba(0, 0, 0, 1)">v1
metadata:
name: cephfs</span>-<span style="color: rgba(0, 0, 0, 1)">provisioner
subjects:
</span>-<span style="color: rgba(0, 0, 0, 1)"> kind: ServiceAccount
    name: cephfs</span>-<span style="color: rgba(0, 0, 0, 1)">provisioner
    namespace: kube</span>-<span style="color: rgba(0, 0, 0, 1)">system
roleRef:
kind: ClusterRole
name: cephfs</span>-<span style="color: rgba(0, 0, 0, 1)">provisioner
apiGroup: rbac.authorization.k8s.io

</span>---<span style="color: rgba(0, 0, 0, 1)">
apiVersion: apps</span>/<span style="color: rgba(0, 0, 0, 1)">v1
kind: Deployment
metadata:
name: cephfs</span>-<span style="color: rgba(0, 0, 0, 1)">provisioner
namespace: kube</span>-<span style="color: rgba(0, 0, 0, 1)">system
spec:
selector:
    matchLabels:
      app: cephfs</span>-<span style="color: rgba(0, 0, 0, 1)">provisioner
replicas: </span><span style="color: rgba(128, 0, 128, 1)">1</span><span style="color: rgba(0, 0, 0, 1)">
strategy:
    type: Recreate
template:
    metadata:
      labels:
      app: cephfs</span>-<span style="color: rgba(0, 0, 0, 1)">provisioner
    spec:
      containers:
      </span>- name: cephfs-<span style="color: rgba(0, 0, 0, 1)">provisioner
      image: </span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">quay.io/external_storage/cephfs-provisioner:latest</span><span style="color: rgba(128, 0, 0, 1)">"</span>
      <span style="color: rgba(0, 0, 255, 1)">env</span><span style="color: rgba(0, 0, 0, 1)">:
      </span>-<span style="color: rgba(0, 0, 0, 1)"> name: PROVISIONER_NAME
          value: ceph.com</span>/<span style="color: rgba(0, 0, 0, 1)">cephfs
      command:
      </span>- <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">/usr/local/bin/cephfs-provisioner</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
      args:
      </span>- <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">-id=cephfs-provisioner-1</span><span style="color: rgba(128, 0, 0, 1)">"</span>
      - <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">-disable-ceph-namespace-isolation=true</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
      serviceAccount: cephfs</span>-<span style="color: rgba(0, 0, 0, 1)">provisioner
EOF
# kubectl apply </span>-f external-storage-cephfs-<span style="color: rgba(0, 0, 0, 1)">provisioner.yaml
# kubectl get pod </span>-n kube-system |<span style="color: rgba(0, 0, 255, 1)">grep</span><span style="color: rgba(0, 0, 0, 1)"> cephfs
cephfs</span>-provisioner-847468fc-5k8vx   <span style="color: rgba(128, 0, 128, 1)">1</span>/<span style="color: rgba(128, 0, 128, 1)">1</span>   Running   <span style="color: rgba(128, 0, 128, 1)">0</span>          7m39s</pre>
</div>
<p>配置secret</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 0, 1)">查看key 在ceph的mon或者admin节点
ceph auth get</span>-<span style="color: rgba(0, 0, 0, 1)">key client.admin

创建 admin secret
# kubectl create secret generic ceph</span>-secret --type=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">kubernetes.io/rbd</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)"> \
</span>--from-literal=key=AQCBrJ9eV/U5NBAAoDlM4gV3a+KNQDBOUqVxdw==<span style="color: rgba(0, 0, 0, 1)"> \
</span>--namespace=kube-<span style="color: rgba(0, 0, 0, 1)">system

查看
# kubectl get secret ceph</span>-secret -n kube-system -<span style="color: rgba(0, 0, 0, 1)">o yaml
apiVersion: v1
data:
key: QVFDQnJKOWVWL1U1TkJBQW9EbE00Z1YzYStLTlFEQk9VcVZ4ZHc9PQ</span>==<span style="color: rgba(0, 0, 0, 1)">
kind: Secret
metadata:
creationTimestamp: </span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">2020-06-08T08:17:09Z</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
name: ceph</span>-<span style="color: rgba(0, 0, 0, 1)">secret
namespace: kube</span>-<span style="color: rgba(0, 0, 0, 1)">system
resourceVersion: </span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">42732</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
selfLink: </span>/api/v1/namespaces/kube-system/secrets/ceph-<span style="color: rgba(0, 0, 0, 1)">secret
uid: efec109a</span>-17de-4f72-afd4-<span style="color: rgba(0, 0, 0, 1)">d126f4d4f8d6
type: kubernetes.io</span>/rbd</pre>
</div>
<p>配置 StorageClass</p>
<div class="cnblogs_code">
<pre># vim storageclass-<span style="color: rgba(0, 0, 0, 1)">cephfs.yaml
kind: StorageClass
apiVersion: storage.k8s.io</span>/<span style="color: rgba(0, 0, 0, 1)">v1
metadata:
name: dynamic</span>-<span style="color: rgba(0, 0, 0, 1)">cephfs
provisioner: ceph.com</span>/<span style="color: rgba(0, 0, 0, 1)">cephfs
parameters:
    monitors: </span><span style="color: rgba(128, 0, 128, 1)">192.168</span>.<span style="color: rgba(128, 0, 128, 1)">0.246</span>:<span style="color: rgba(128, 0, 128, 1)">6789</span>,<span style="color: rgba(128, 0, 128, 1)">192.168</span>.<span style="color: rgba(128, 0, 128, 1)">0.247</span>:<span style="color: rgba(128, 0, 128, 1)">6789</span>,<span style="color: rgba(128, 0, 128, 1)">192.168</span>.<span style="color: rgba(128, 0, 128, 1)">0.248</span>:<span style="color: rgba(128, 0, 128, 1)">6789</span><span style="color: rgba(0, 0, 0, 1)">
    adminId: admin
    adminSecretName: ceph</span>-<span style="color: rgba(0, 0, 0, 1)">secret
    adminSecretNamespace: </span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">kube-system</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">
    claimRoot: </span>/volumes/<span style="color: rgba(0, 0, 0, 1)">kubernetes

# kubectl apply -f storageclass-<span style="color: rgba(0, 0, 0, 1)">cephfs.yaml
storageclass.storage.k8s.io</span>/dynamic-<span style="color: rgba(0, 0, 0, 1)">cephfs created
# kubectl get sc
NAME               PROVISIONER       RECLAIMPOLICY   VOLUMEBINDINGMODE   ALLOWVOLUMEEXPANSION   AGE
dynamic</span>-ceph-rdb   ceph.com/rbd      Delete          Immediate         <span style="color: rgba(0, 0, 255, 1)">false</span><span style="color: rgba(0, 0, 0, 1)">                  59m
dynamic</span>-cephfs   ceph.com/cephfs   Delete          Immediate         <span style="color: rgba(0, 0, 255, 1)">false</span>                  5s</pre>
</div>
<p>创建pvc测试</p>
<div class="cnblogs_code">
<pre># <span style="color: rgba(0, 0, 255, 1)">cat</span> &gt;cephfs-pvc-test.yaml&lt;&lt;<span style="color: rgba(0, 0, 0, 1)">EOF
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: cephfs</span>-<span style="color: rgba(0, 0, 0, 1)">claim
spec:
accessModes:   
    </span>-<span style="color: rgba(0, 0, 0, 1)"> ReadWriteOnce
storageClassName: dynamic</span>-<span style="color: rgba(0, 0, 0, 1)">cephfs
resources:
    requests:
      storage: 2Gi
EOF</span><span style="color: rgba(0, 0, 0, 1)">
# kubectl apply </span>-f cephfs-pvc-<span style="color: rgba(0, 0, 0, 1)">test.yaml
persistentvolumeclaim</span>/cephfs-<span style="color: rgba(0, 0, 0, 1)">claim created
# kubectl get pv,pvc
NAME                                                      CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM                  STORAGECLASS   REASON   AGE
persistentvolume</span>/pvc-df8768d7-<span style="color: rgba(128, 0, 128, 1)">5111</span>-4e14-a0cf-dd029b00469b   2Gi      RWO            Delete         Bound    default/cephfs-claim   dynamic-<span style="color: rgba(0, 0, 0, 1)">cephfs            12s

NAME                                 STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   AGE
persistentvolumeclaim</span>/cephfs-claim   Bound    pvc-df8768d7-<span style="color: rgba(128, 0, 128, 1)">5111</span>-4e14-a0cf-dd029b00469b   2Gi      RWO            dynamic-cephfs   13s</pre>
</div>
<p>创建 nginx pod 挂载测试</p>
<div class="cnblogs_code">
<pre># <span style="color: rgba(0, 0, 255, 1)">cat</span> &gt;nginx-pod.yaml&lt;&lt;<span style="color: rgba(0, 0, 0, 1)">EOF
apiVersion: v1
kind: Pod
metadata:
name: nginx</span>-<span style="color: rgba(0, 0, 0, 1)">pod2
labels:
    name: nginx</span>-<span style="color: rgba(0, 0, 0, 1)">pod2
spec:
containers:
</span>- name: nginx-<span style="color: rgba(0, 0, 0, 1)">pod2
    image: nginx
    ports:
    </span>-<span style="color: rgba(0, 0, 0, 1)"> name: web
      containerPort: </span><span style="color: rgba(128, 0, 128, 1)">80</span><span style="color: rgba(0, 0, 0, 1)">
    volumeMounts:
    </span>-<span style="color: rgba(0, 0, 0, 1)"> name: cephfs
      mountPath: </span>/usr/share/nginx/<span style="color: rgba(0, 0, 0, 1)">html
volumes:
</span>-<span style="color: rgba(0, 0, 0, 1)"> name: cephfs
    persistentVolumeClaim:
      claimName: cephfs</span>-<span style="color: rgba(0, 0, 0, 1)">claim
EOF
# kubectl apply </span>-f nginx-<span style="color: rgba(0, 0, 0, 1)">pod.yaml
# kubectl get pod -<span style="color: rgba(0, 0, 0, 1)">o wide
NAME         READY   STATUS    RESTARTS   AGE   IP         NODE          NOMINATED NODE   READINESS GATES
nginx</span>-pod2   <span style="color: rgba(128, 0, 128, 1)">1</span>/<span style="color: rgba(128, 0, 128, 1)">1</span>   Running   <span style="color: rgba(128, 0, 128, 1)">0</span>          37s   <span style="color: rgba(128, 0, 128, 1)">10.244</span>.<span style="color: rgba(128, 0, 128, 1)">2.5</span>   k8s-master1   &lt;none&gt;         &lt;none&gt;<span style="color: rgba(0, 0, 0, 1)">
# kubectl exec -ti nginx-pod2 -- /bin/<span style="color: rgba(0, 0, 255, 1)">sh</span> -c <span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(128, 0, 0, 1)">echo This is from CephFS!!! &gt; /usr/share/nginx/html/index.html</span><span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(0, 0, 0, 1)">
# curl <span style="color: rgba(128, 0, 128, 1)">10.244</span>.<span style="color: rgba(128, 0, 128, 1)">2.5</span><span style="color: rgba(0, 0, 0, 1)">
This is from CephFS</span>!!!<span style="color: rgba(0, 0, 0, 1)">
###查看挂载信息
# kubectl exec -ti nginx-pod2 -- /bin/<span style="color: rgba(0, 0, 255, 1)">sh</span> -c <span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(128, 0, 0, 1)">df -h</span><span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(0, 0, 0, 1)">
Filesystem                                                                                                                                           SizeUsed Avail Use</span>%<span style="color: rgba(0, 0, 0, 1)"> Mounted on
overlay                                                                                                                                             76G</span><span style="color: rgba(128, 0, 128, 1)">4</span>.1G   72G   <span style="color: rgba(128, 0, 128, 1)">6</span>% /<span style="color: rgba(0, 0, 0, 1)">
tmpfs                                                                                                                                                 64M   </span><span style="color: rgba(128, 0, 128, 1)">0</span>   64M   <span style="color: rgba(128, 0, 128, 1)">0</span>% /<span style="color: rgba(0, 0, 0, 1)">dev
tmpfs                                                                                                                                                </span><span style="color: rgba(128, 0, 128, 1)">1</span>.4G   <span style="color: rgba(128, 0, 128, 1)">0</span><span style="color: rgba(128, 0, 128, 1)">1</span>.4G   <span style="color: rgba(128, 0, 128, 1)">0</span>% /sys/fs/<span style="color: rgba(0, 0, 0, 1)">cgroup
</span>/dev/sda3                                                                                                                                             76G<span style="color: rgba(128, 0, 128, 1)">4</span>.1G   72G   <span style="color: rgba(128, 0, 128, 1)">6</span>% /etc/<span style="color: rgba(0, 0, 0, 1)">hosts
shm                                                                                                                                                   64M   </span><span style="color: rgba(128, 0, 128, 1)">0</span>   64M   <span style="color: rgba(128, 0, 128, 1)">0</span>% /dev/<span style="color: rgba(0, 0, 0, 1)">shm
</span><span style="color: rgba(128, 0, 128, 1)">192.168</span>.<span style="color: rgba(128, 0, 128, 1)">0.246</span>:<span style="color: rgba(128, 0, 128, 1)">6789</span>,<span style="color: rgba(128, 0, 128, 1)">192.168</span>.<span style="color: rgba(128, 0, 128, 1)">0.247</span>:<span style="color: rgba(128, 0, 128, 1)">6789</span>,<span style="color: rgba(128, 0, 128, 1)">192.168</span>.<span style="color: rgba(128, 0, 128, 1)">0.248</span>:<span style="color: rgba(128, 0, 128, 1)">6789</span>:/volumes/kubernetes/kubernetes/kubernetes-dynamic-pvc-e957596e-a969-11ea-<span style="color: rgba(128, 0, 128, 1)">8966</span>-cec7bd638523   85G   <span style="color: rgba(128, 0, 128, 1)">0</span>   85G   <span style="color: rgba(128, 0, 128, 1)">0</span>% /usr/share/nginx/<span style="color: rgba(0, 0, 0, 1)">html
tmpfs                                                                                                                                                </span><span style="color: rgba(128, 0, 128, 1)">1</span>.4G   12K<span style="color: rgba(128, 0, 128, 1)">1</span>.4G   <span style="color: rgba(128, 0, 128, 1)">1</span>% /run/secrets/kubernetes.io/<span style="color: rgba(0, 0, 0, 1)">serviceaccount
tmpfs                                                                                                                                                </span><span style="color: rgba(128, 0, 128, 1)">1</span>.4G   <span style="color: rgba(128, 0, 128, 1)">0</span><span style="color: rgba(128, 0, 128, 1)">1</span>.4G   <span style="color: rgba(128, 0, 128, 1)">0</span>% /proc/<span style="color: rgba(0, 0, 0, 1)">acpi
tmpfs                                                                                                                                                </span><span style="color: rgba(128, 0, 128, 1)">1</span>.4G   <span style="color: rgba(128, 0, 128, 1)">0</span><span style="color: rgba(128, 0, 128, 1)">1</span>.4G   <span style="color: rgba(128, 0, 128, 1)">0</span>% /proc/<span style="color: rgba(0, 0, 0, 1)">scsi
tmpfs                                                                                                                                                </span><span style="color: rgba(128, 0, 128, 1)">1</span>.4G   <span style="color: rgba(128, 0, 128, 1)">0</span><span style="color: rgba(128, 0, 128, 1)">1</span>.4G   <span style="color: rgba(128, 0, 128, 1)">0</span>% /sys/firmware</pre>
</div><br><br>
来源:https://www.cnblogs.com/yuezhimi/p/13066663.html
頁: [1]
查看完整版本: kubernetes使用ceph存储