我开始使用 Kubernates,但在使用 Kubernetes 和 GCE Persistent 磁盘安装 Postgres 时遇到问题。我可以使用 Kubernates 演练和以下指南成功安装 Mysql: http
但是,当我尝试用 postgres 实现类似的事情时,在附加到磁盘或使用磁盘时似乎失败了。我已经创建了一个基于上面帖子中的 mysql 的 pod yaml,但替换了 postgres docker 图像:
apiVersion: v1beta1
id: postgres
desiredState:
manifest:
version: v1beta1
id: postgres
containers:
- name: postgres
image: postgres
env:
- name: DB_PASS
value: password
cpu: 100
ports:
- containerPort: 5432
volumeMounts:
# name must match the volume name below
- name: persistent-storage
# mount path within the container
mountPath: /var/lib/postgresql/data
volumes:
- name: persistent-storage
source:
persistentDisk:
# This GCE …Run Code Online (Sandbox Code Playgroud)