在设置新集群时,我删除了一个 Azure 存储帐户,希望控制器重新创建它,但是,现在当我尝试使用azurefile
PVC 时,出现一条错误消息,提示无法解析文件共享地址。
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: 'workspace-storage-j5vzpx4z'
namespace: ide
labels:
component: user-storage
userid: !f 'j5vzpx4z'
spec:
storageClassName: azurefile
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1Gi
pod日志显示:
Warning FailedMount <invalid> kubelet, aks-nodepool1-22436891-vmss000000 MountVolume.SetUp failed for volume "pvc-3e7e8869-ecce-4fef-8440-0594f5546962" : mount failed: exit status 1
Mounting command: systemd-run
Mounting arguments: --description=Kubernetes transient mount for /var/lib/kubelet/pods/9e9828bc-622f-4bb4-bd27-8c2051876700/volumes/kubernetes.io~azure-file/pvc-3e7e8869-ecce-4fef-8440-0594f5546962 --scope -- mount -t cifs -o username=f7e7421469e4443b786ad1c,password=wl+/E9DeEClxfshVccI6FrjjAHDfWviACj0jtHyyyaIoXka6BXm3BpKsNwD/P5/zdZO94tduFN0vuvNQsxI8Lw==,file_mode=0777,dir_mode=0777,vers=3.0 //f7e7421469e4443b786ad1c.file.core.windows.net/kubernetes-dynamic-pvc-3e7e8869-ecce-4fef-8440-0594f5546962 /var/lib/kubelet/pods/9e9828bc-622f-4bb4-bd27-8c2051876700/volumes/kubernetes.io~azure-file/pvc-3e7e8869-ecce-4fef-8440-0594f5546962
Output: Running scope as unit run-r29ba9063eb1c457e993a2e740ca2e7dd.scope.
mount error: could not resolve address for f7e7421469e4443b786ad1c.file.core.windows.net: Unknown error
我怎样才能解决这个问题?
答案1
您需要在 Kubernetes 中删除并重新创建 PVC。当 Kubernetes 在 PVC 设置过程中创建文件共享时,它会假定它拥有并管理该文件共享。如果您在该范围之外删除它,它不知道您已经这样做了,也不知道它需要重新创建它。