NFS Persistent Volume Claim 无限期悬而未决
NFS Persistent Volume Claim remains pending indefinitely
我在创建 PVC 时遇到以下错误,我不知道这意味着什么。
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal ExternalExpanding 1m (x3 over 5m) volume_expand Ignoring the PVC: didn't find a plugin capable of expanding the volume; waiting for an external
controller to process this PVC.
我的 PV 在那里,看起来还不错。
这是我的 PV 和 PVC 的规范。
apiVersion: v1
kind: PersistentVolume
metadata:
creationTimestamp: null
finalizers:
- kubernetes.io/pv-protection
labels:
app: projects-service
app-guid: design-center-projects-service
asset: service
chart: design-center-projects-service
class: projects-service-nfs
company: mulesoft
component: projects
component-asset: projects-service
heritage: Tiller
product: design-center
product-component: design-center-projects
release: design-center-projects-service
name: projects-service-nfs
selfLink: /api/v1/persistentvolumes/projects-service-nfs
spec:
accessModes:
- ReadWriteOnce
capacity:
storage: 30Gi
claimRef:
apiVersion: v1
kind: PersistentVolumeClaim
name: projects-service-nfs-block
namespace: design-center
resourceVersion: "7932052"
uid: d114dd38-f411-11e8-b7b1-1230f683f84a
mountOptions:
- nfsvers=3
- hard
- sync
nfs:
path: /
server: 1.1.1.1
persistentVolumeReclaimPolicy: Retain
volumeMode: Block
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
finalizers:
- kubernetes.io/pvc-protection
labels:
app: projects-service
app-guid: design-center-projects-service
asset: service
chart: design-center-projects-service
company: mulesoft
component: projects
component-asset: projects-service
example: test
heritage: Tiller
product: design-center
product-component: design-center-projects
release: design-center-projects-service
name: projects-service-nfs-block
selfLink: /api/v1/namespaces/design-center/persistentvolumeclaims/projects-service-nfs-block
spec:
accessModes:
- ReadWriteOnce
dataSource: null
resources:
requests:
storage: 20Gi
selector:
matchLabels:
class: projects-service-nfs
storageClassName: ""
volumeMode: Block
volumeName: projects-service-nfs
版本:
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.2", GitCommit:"bb9ffb1654d4a729bb4cec18ff088eacc153c239", GitTreeState:"clean", BuildDate:"2018-08-08T16:31:10Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"12", GitVersion:"v1.12.1", GitCommit:"4ed3216f3ec431b140b1d899130a69fc671678f4", GitTreeState:"clean", BuildDate:"2018-10-05T16:36:14Z", GoVersion:"go1.10.4", Compiler:"gc", Platform:"linux/amd64"}
看起来你在某些时候updated/expanded the PVC?正在调用:
func (expc *expandController) pvcUpdate(oldObj, newObj interface{})
...
在函数中它试图找到一个扩展插件,但找不到它:
volumePlugin, err := expc.volumePluginMgr.FindExpandablePluginBySpec(volumeSpec)
if err != nil || volumePlugin == nil {
err = fmt.Errorf("didn't find a plugin capable of expanding the volume; " +
"waiting for an external controller to process this PVC")
...
return
}
如果您看到此 document,则表明以下卷类型支持使用树内插件进行 PVC 扩展:AWS-EBS、GCE-PD、Azure Disk、Azure File、Glusterfs、Cinder、Portworx、和 Ceph RBD。所以 NFS 不是其中之一,这就是您看到该事件的原因。看起来它可能在未来得到支持,或者也可以通过自定义插件得到支持。
如果您还没有更新 PVC,我建议您对 PV 和 PVC 使用与所述相同的容量 here
我在创建 PVC 时遇到以下错误,我不知道这意味着什么。
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal ExternalExpanding 1m (x3 over 5m) volume_expand Ignoring the PVC: didn't find a plugin capable of expanding the volume; waiting for an external
controller to process this PVC.
我的 PV 在那里,看起来还不错。
这是我的 PV 和 PVC 的规范。
apiVersion: v1
kind: PersistentVolume
metadata:
creationTimestamp: null
finalizers:
- kubernetes.io/pv-protection
labels:
app: projects-service
app-guid: design-center-projects-service
asset: service
chart: design-center-projects-service
class: projects-service-nfs
company: mulesoft
component: projects
component-asset: projects-service
heritage: Tiller
product: design-center
product-component: design-center-projects
release: design-center-projects-service
name: projects-service-nfs
selfLink: /api/v1/persistentvolumes/projects-service-nfs
spec:
accessModes:
- ReadWriteOnce
capacity:
storage: 30Gi
claimRef:
apiVersion: v1
kind: PersistentVolumeClaim
name: projects-service-nfs-block
namespace: design-center
resourceVersion: "7932052"
uid: d114dd38-f411-11e8-b7b1-1230f683f84a
mountOptions:
- nfsvers=3
- hard
- sync
nfs:
path: /
server: 1.1.1.1
persistentVolumeReclaimPolicy: Retain
volumeMode: Block
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
finalizers:
- kubernetes.io/pvc-protection
labels:
app: projects-service
app-guid: design-center-projects-service
asset: service
chart: design-center-projects-service
company: mulesoft
component: projects
component-asset: projects-service
example: test
heritage: Tiller
product: design-center
product-component: design-center-projects
release: design-center-projects-service
name: projects-service-nfs-block
selfLink: /api/v1/namespaces/design-center/persistentvolumeclaims/projects-service-nfs-block
spec:
accessModes:
- ReadWriteOnce
dataSource: null
resources:
requests:
storage: 20Gi
selector:
matchLabels:
class: projects-service-nfs
storageClassName: ""
volumeMode: Block
volumeName: projects-service-nfs
版本:
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.2", GitCommit:"bb9ffb1654d4a729bb4cec18ff088eacc153c239", GitTreeState:"clean", BuildDate:"2018-08-08T16:31:10Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"12", GitVersion:"v1.12.1", GitCommit:"4ed3216f3ec431b140b1d899130a69fc671678f4", GitTreeState:"clean", BuildDate:"2018-10-05T16:36:14Z", GoVersion:"go1.10.4", Compiler:"gc", Platform:"linux/amd64"}
看起来你在某些时候updated/expanded the PVC?正在调用:
func (expc *expandController) pvcUpdate(oldObj, newObj interface{})
...
在函数中它试图找到一个扩展插件,但找不到它:
volumePlugin, err := expc.volumePluginMgr.FindExpandablePluginBySpec(volumeSpec)
if err != nil || volumePlugin == nil {
err = fmt.Errorf("didn't find a plugin capable of expanding the volume; " +
"waiting for an external controller to process this PVC")
...
return
}
如果您看到此 document,则表明以下卷类型支持使用树内插件进行 PVC 扩展:AWS-EBS、GCE-PD、Azure Disk、Azure File、Glusterfs、Cinder、Portworx、和 Ceph RBD。所以 NFS 不是其中之一,这就是您看到该事件的原因。看起来它可能在未来得到支持,或者也可以通过自定义插件得到支持。
如果您还没有更新 PVC,我建议您对 PV 和 PVC 使用与所述相同的容量 here