申明:答案僅供參考,最后得分看考官!!!
同樣的答案,有人能得90多分,有人只能及格,但只要操作環境正確,最后能出正確結果,及格肯定沒問題!

將yaml檔案復制到記事本修改后,粘貼到webshell視窗
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pv-volume
spec:
storageClassName: csi-hostpath-sc
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Mi
---
apiVersion: v1
kind: Pod
metadata:
name: web-server
spec:
volumes:
- name: task-pv-storage
persistentVolumeClaim:
claimName: pv-volume
containers:
- name: web-server
image: nginx
ports:
- containerPort: 80
name: "http-server"
volumeMounts:
- mountPath: "/usr/share/nginx/html"
name: task-pv-storage
$ kubectl config use-context ok8s
$ vi pv-volume-pvc.yaml
# 將上面的yaml內容粘貼進來
$ kubectl apply -f pv-volume-pvc.yaml
# 驗證
$ kubectl get pvc
# 修改pvc 10Mi --> 70Mi
$ kubectl edit pvc pv-volume --record
參考:
配置 Pod 以使用 PersistentVolume 作為存盤
20年11月28日最新CKA認證試題 CSDN博客地址
20年11月28日最新CKA認證試題 簡書地址
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/229116.html
標籤:其他
