was originally tested on a local test machine, and the environment was tested on a stand-alone version of K8s of 1.9.2. The configuration files are mainly as follows:
provisioner.yml
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
name: nfs-client-deploy
spec:
replicas: 1
strategy:
type: Recreate
template:
metadata:
labels:
app: nfs-client-deploy
spec:
serviceAccount: nfs-client-provisioner
containers:
- name: nfs-client-provisioner
image: registry.cn-hangzhou.aliyuncs.com/open-ali/nfs-client-provisioner
volumeMounts:
- name: nfs-client
mountPath: /persistentvolumes
env:
- name: PROVISIONER_NAME
value: my-provisioner
- name: NFS_SERVER
value: 192.168.163.184
- name: NFS_PATH
value: /root/docker
volumes:
- name: nfs-client
nfs:
server: 192.168.163.184
path: /root/docker
storageclass.yml
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: nfs-storage
provisioner: -provisioner
test-claim.yaml
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: test-claim
spec:
accessModes:
- ReadWriteMany
storageClassName: nfs-storage
resources:
requests:
storage: 1Mi
the above two files are mainly for creating storageclss, and the last one is mainly for a test.
the current problem is that pvc has always been pending in the cluster of my test environment, as shown in the following figure:
then the corresponding pod is also in pending all the time. Check the hint through describe:
pod has unbound immediate PersistentVolumeClaims (repeated 4 times)
. I don"t know what caused the problem. Previously, OK, asked God for guidance in version 1.9.2.