这是我对 K8s 的 postgress 配置
apiVersion: apps/v1
kind: Deployment
metadata:
name: postgres-deployment
spec:
replicas: 1
selector:
matchLabels:
component: postgres
template:
metadata:
labels:
component: postgres
spec:
volumes:
- name: postgres-storage
persistentVolumeClaim:
claimName: database-persistent-volume-claim
containers:
- name: postgres
image: postgres
ports:
- containerPort: 5432
volumeMounts:
- mountPath: /var/lib/postgresql/data
name: postgres-storage
以下是事件日志
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 35s default-scheduler Successfully assigned default/postgres-deployment-d57b94d8-qnk8j to docker-desktop
Normal Pulling 11s (x3 over 34s) kubelet, docker-desktop Pulling image "postgres"
Normal Pulled 6s (x3 over 30s) kubelet, docker-desktop Successfully pulled image "postgres"
Normal Created 6s (x3 over 29s) kubelet, docker-desktop Created container postgres
Warning Failed 6s (x3 over 29s) kubelet, docker-desktop Error: failed to start container "postgres": Error response from daemon: error while creating mount source path '/host_mnt/c/Users/DupinderDhiman/.docker/Volumes/database-persistent-volume-claim/pvc-c8155b21-10d9-11ea-b05a-00155d380104': mkdir /host_mnt/c/Users/DupinderDhiman/.docker: permission denied
是的,我知道你会说,共享驱动器。我做了
docker run --rm -v c:/Users:/data alpine ls /data
All Users
CatalystOne
Default
Default User
DupinderDhiman
Public
desktop.ini
这个命令运行得很好
所以问题与驱动共享无关
好的,下一个问题可能与 c:/specificFolder 权限有关。我检查了共享权限中的所有复选框
现在我被困住了