【发布时间】:2022-01-21 13:04:39
【问题描述】:
我正在使用 minikube 来运行我的 Kubernetes 部署:
聚氯乙烯:
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pipeline
spec:
storageClassName:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
吊舱:
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: test1
name: test1
spec:
replicas: 1
selector:
matchLabels:
app: test1
template:
metadata:
labels:
app: test1
spec:
containers:
- env:
- name: SHARED_FOLDER_PATH
value: /data/shared
image: docker.io/foo/test1:st3
imagePullPolicy: Always
name: test1
ports:
- containerPort: 8061
name: protobuf-api
- containerPort: 8062
name: webui
volumeMounts:
- mountPath: /data/shared
name: test1
imagePullSecrets:
- name: acumos-registry
volumes:
- name: test1
persistentVolumeClaim:
claimName: pipeline
我已检查 pod 和 pvc 是否正在运行:
$ kubectl describe pv,pvc
Name: pvc-34bbd532-9c55-45cc-ab96-1accd08ded6e
Labels: <none>
Annotations: hostPathProvisionerIdentity: c6eeb812-6b82-4546-bc5a-8917cf0d3d6b
pv.kubernetes.io/provisioned-by: k8s.io/minikube-hostpath
Finalizers: [kubernetes.io/pv-protection]
StorageClass: standard
Status: Bound
Claim: test/pipeline
Reclaim Policy: Delete
Access Modes: RWO
VolumeMode: Filesystem
Capacity: 1Gi
Node Affinity: <none>
Message:
Source:
Type: HostPath (bare host directory volume)
Path: /tmp/hostpath-provisioner/test/pipeline
HostPathType:
Events: <none>
我正在尝试从主机访问 minikube 文件夹中的数据:/tmp/hostpath-provisioner/test/pipeline。为此,我正在安装本地卷:
$ minikube mount /tmp/hostpath-provisioner/test/pipeline:/tmp/hostpath-provisioner/test/pipeline
我已经通过 ssh 检查了 minikube 文件夹中是否有任何数据:
docker@minikube:/tmp/hostpath-provisioner/test/pipeline$ ls -a
. .. classes.json
但我在本地文件夹中看不到此信息
【问题讨论】:
标签: kubernetes minikube kubernetes-pvc