如何解决如何配置 Postgres Kubernetes 容器OSX 和 Minikube的卷挂载
我正在尝试使用 minikube 设置 postgres pod。我的部署中的 pod 配置中有以下内容
volumeMounts:
- mountPath: /var/lib/postgresql/data
name: postgredb
volumes:
- name: postgredb
persistentVolumeClaim:
claimName: postgres-pv-claim
但是当我跑步时我得到
initdb: error: directory "/var/lib/postgresql/data" exists but is not empty
It contains a dot-prefixed/invisible file,perhaps due to it being a mount point.
Using a mount point directly as the data directory is not recommended.
Create a subdirectory under the mount point.
所以我改成
volumeMounts:
- mountPath: /var/lib/postgresql/data
name: postgredb
subPath: db
但后来我明白了……
2021-02-19 03:53:24.760 UTC [30] LOG: could not link file "pg_wal/xlogtemp.30" to "pg_wal/000000010000000000000001": Operation not permitted
2021-02-19 03:53:24.761 UTC [30] FATAL: could not open file "pg_wal/000000010000000000000001": No such file or directory
这是在 OSX 上使用 minikube,我如何让它工作?
我也试过
env:
- name: PGDATA
value: /var/lib/postgresql/data/db_data
envFrom:
- configMapRef:
name: db-config
volumeMounts:
- mountPath: /var/lib/postgresql/data
name: postgredb
subPath: db_data
但还是得到
2021-02-19 03:53:24.760 UTC [30] LOG: could not link file "pg_wal/xlogtemp.30" to "pg_wal/000000010000000000000001": Operation not permitted
2021-02-19 03:53:24.761 UTC [30] FATAL: could not open file "pg_wal/000000010000000000000001": No such file or directory
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。