常见问题

mount

storageClassName: 名称不同匹配不到

Permission denied 远程目录权限

securityContext.fsGroup

1
2
3
4
5
6
securityContext:
runAsUser: 65534
runAsNonRoot: true
runAsGroup: 65534
fsGroup: 65534
fsGroupChangePolicy: "OnRootMismatch" #1.22以上,首次启动时才会执行chmod或chown操作

PVC不能安装两次

Unable to attach or mount volumes: unmounted volumes=[storage-volume], unattached volumes=[kube-api-access-jrz96 storage-volume config-volume]: timed out waiting for the condition

/var/lib/kubelet/pods/eb4c9f58-b7c7-4663-8f9a-1cc447c51fe6/volumes/kubernetes.io~nfs/prometheus-pv0 Output: mount.nfs: mounting 192.168.122.6:/opt/data/k8s/prometheus/pv0 failed, reason given by server: No such file or directory

检查权限

Connection refused

① 首先看nfs服务是否开启
② 其次看rpcbind是否开启

/etc/kubernetes/manifests

node 没有这个目录

1
--pod-manifest-path=/etc/kubernetes/manifests   #StaticPodPath

file_linux.go:61] “Unable to read config path” err=”path does not exist, ignoring” path=”/etc/kubernetes/manifests”

解决方法,手动创建

StatefulSet

updates to statefulset spec for fields other than ‘replicas’, ‘template’, ‘updateStrategy’, ‘persistentVolumeClaimRetentionPolicy’ and ‘minReadySeconds’ are forbidden

只能更新这些字段

pvc

write to WAL: log samples: write /data/wal/00000157: stale NFS file handle”

客户端没有umount,重新挂载(检查服务端nfs是正常状态)

1
2
3
kubectl describe  pv grafana-pv1

kubectl describe pvc grafana -n monitor

Warning ProvisioningFailed 8s (x17 over 4m5s) persistentvolume-controller storageclass.storage.k8s.io “grafana-data” not found

https://kubernetes.io/zh-cn/docs/concepts/storage/dynamic-provisioning/

点击打赏
文章目录
  1. 1. mount
    1. 1.1. Permission denied 远程目录权限
    2. 1.2. PVC不能安装两次
    3. 1.3. Connection refused
  2. 2. /etc/kubernetes/manifests
  3. 3. StatefulSet
    1. 3.1. pvc
载入天数...载入时分秒... ,