![](/img/trans.png)
[英]Kubernetes - Windows container on Azure container service issues with azure file persistent volume mount
[英]how to inspect the content of persistent volume by kubernetes on azure cloud service
我已將軟件打包到容器中。 我需要通過 Azure 容器服務將容器放入集群。 該軟件具有目錄/src/data/
,我想訪問整個目錄的內容。
搜索后,我必須解決。
我需要訪問和管理 Azure 集群上的輸出目錄。 換句話說,我需要一個救世主。
正如我在這里解釋的那樣,通常,如果您可以使用kubectl
與集群kubectl
,您可以創建一個 pod/容器,將 PVC 安裝在里面,並使用容器的工具來,例如, ls
的內容。 如果您需要更高級的編輯工具,請將容器圖像busybox
替換為自定義工具。
創建檢查員窗格
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Pod
metadata:
name: pvc-inspector
spec:
containers:
- image: busybox
name: pvc-inspector
command: ["tail"]
args: ["-f", "/dev/null"]
volumeMounts:
- mountPath: /pvc
name: pvc-mount
volumes:
- name: pvc-mount
persistentVolumeClaim:
claimName: YOUR_CLAIM_NAME_HERE
EOF
檢查內容
kubectl exec -it pvc-inspector -- sh
$ ls /pvc
清理
kubectl delete pod pvc-inspector
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.