日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

K8s 1.23.x版本nfs持久存储报错 persistentvolume-controller waiting for a volume to be created, either by ext

發(fā)布時(shí)間:2023/12/29 编程问答 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 K8s 1.23.x版本nfs持久存储报错 persistentvolume-controller waiting for a volume to be created, either by ext 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

最近在學(xué)習(xí)k8s的相關(guān)知識(shí),嗯,出現(xiàn)一些問題,記錄下。

說明

Docker 20.10.12
kubeadm-v1.23.4
kubelet-v1.23.4
kubectl-v1.23.4

對(duì),需要對(duì)volume,pv,pvc有了解哈
在使用nfs持久化存儲(chǔ)這塊出現(xiàn)的問題
nfs的k8s持久化存儲(chǔ)的插件:https://github.com/kubernetes-retired/external-storage/tree/master/nfs

問題及解決

在創(chuàng)建pvc報(bào)的錯(cuò)

kubectl apply -f my-pvc.yaml
kubectl get pvc

這塊有一些問題,就是

[root@k8sm storage]# kubectl describe pvc Name: my-pvc Namespace: default StorageClass: example-nfs Status: Pending Volume: Labels: <none> Annotations: control-plane.alpha.kubernetes.io/leader:{"holderIdentity":"7c4527be-a9ea-11ec-93ce-3a41d59f9259","leaseDurationSeconds":15,"acquireTime":"2022-03-22T14:30:27Z","renewTime":"2022-...volume.beta.kubernetes.io/storage-class: example-nfsvolume.beta.kubernetes.io/storage-provisioner: example.com/nfsvolume.kubernetes.io/storage-provisioner: example.com/nfs Finalizers: [kubernetes.io/pvc-protection] Capacity: Access Modes: VolumeMode: Filesystem Used By: <none> Events:Type Reason Age From Message---- ------ ---- ---- -------Normal ExternalProvisioning 11s (x21 over 43s) persistentvolume-controller waiting for a volume to be created, either by external provisioner "example.com/nfs" or manually created by system administrator

Normal ExternalProvisioning 11s (x21 over 43s) persistentvolume-controller waiting for a volume to be created, either by external provisioner “example.com/nfs” or manually created by system administrator

一直都在pending狀態(tài)
去查了一下,解決方式:

修改apiserver的配置

[root@k8sm storage]# vi /etc/kubernetes/manifests/kube-apiserver.yaml apiVersion: v1 ···- --tls-private-key-file=/etc/kubernetes/pki/apiserver.key- --feature-gates=RemoveSelfLink=false # 添加這個(gè)配置 重啟下kube-apiserver.yaml [root@k8sm manifests]# kubectl apply -f kube-apiserver.yaml[root@k8sm storage]# kubectl get pvc NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE my-pvc Bound pvc-ae9f6d4b-fc4c-4e19-8854-7bfa259a3a04 1Mi RWX example-nfs 13m

就正常了,查了下為什么?
因?yàn)樵瓉硎?.20版本(我的是1.23.4)默認(rèn)禁止使用selfLink。
哦,那啥事selfLink?
selfLink:通過API訪問資源自身的URL,例如一個(gè)Pod的link可能是/api/v1/namespaces/ns36aa8455/pods/sc-cluster-test-1-6bc58d44d6-r8hld

額,到這把。。

總結(jié)

以上是生活随笔為你收集整理的K8s 1.23.x版本nfs持久存储报错 persistentvolume-controller waiting for a volume to be created, either by ext的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。