OpenShift/Kubernetes 创建PostgreSQL 权限不足的问题
在部署PostgreSQL的时候遇到了权限不足的问题chmod: changing permissions of ‘/var/lib/postgresql/data’: Permission denied最后查看文档,在创建Pod,绑定mountPath 时加上:z 就好了PostgreSQL文档You can also set the following mount points
·
在部署PostgreSQL的时候遇到了权限不足的问题
chmod: changing permissions of ‘/var/lib/postgresql/data’: Permission denied
设置NFS目录权限的时候指定no_root_squash权限
echo “NFS目录 *(rw,sync,no_root_squash)” >> /etc/exports
如果不行也可以试试下面的方法:
在创建Pod,绑定mountPath 时加上:Z
PostgreSQL文档
You can also set the following mount points by passing the -v /host/dir:/container/dir:Z flag to Docker.
例如:
---
apiVersion: v1
kind: ReplicationController
metadata:
name: postgres
spec:
replicas: 1
template:
metadata:
labels:
app: postgres
spec:
containers:
- env:
- name: POSTGRES_USER
value: kong
- name: POSTGRES_PASSWORD
value: kong
- name: POSTGRES_DB
value: kong
- name: PGDATA
value: /var/lib/postgresql/data/pgdata
image: "postgres:9.4"
name: postgres
ports:
- containerPort: 5432
volumeMounts:
- mountPath: /var/lib/postgresql/data:Z
name: pg-data
volumes:
- name: pg-data
persistentVolumeClaim:
claimName: pg-data
更多推荐
已为社区贡献3条内容
所有评论(0)