[k8s@dev-kubectl tianchongqi]$ kubectl get pvc
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
example-pvc Terminating 23h
[k8s@dev-kubectl tianchongqi]$ kubectl describe pvc
Name: example-pvc
Namespace: default
StorageClass:
Status: Terminating (lasts 22h)
Volume:
Labels: <none>
Annotations: <none>
Finalizers: [hello.example.com/populate-target-protection]
Capacity:
Access Modes:
VolumeMode: Filesystem
DataSource:
APIGroup: hello.example.com
Kind: Hello
Name: example-hello
Used By: <none>
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal FailedBinding 2m48s (x5647 over 23h) persistentvolume-controller no persistent volumes available for this claim and no storage class is set
[k8s@dev-kubectl tianchongqi]$ cat hello-example.yaml
#apiVersion: hello.example.com/v1alpha1
#kind: Hello
#metadata:
# name: example-hello
#spec:
# fileName: example.txt
# fileContents: Hello, world!
#---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: example-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Mi
dataSourceRef:
apiGroup: hello.example.com
kind: Hello
name: example-hello
volumeMode: Filesystem
storageClassName: huawei-csi-client
---
apiVersion: batch/v1
kind: Job
metadata:
name: example-job
spec:
template:
spec:
containers:
- name: example-container
image: busybox:latest
command:
- cat
- /mnt/example.txt
volumeMounts:
- name: vol
mountPath: /mnt
restartPolicy: Never
volumes:
- name: vol
persistentVolumeClaim:
claimName: example-pvc
[k8s@dev-kubectl tianchongqi]$
相似问题