chown:/var/lib/postgresql/data/postgresql.conf:只读文件系统

编程入门 行业动态 更新时间:2024-10-27 15:25:28
本文介绍了chown:/var/lib/postgresql/data/postgresql.conf:只读文件系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我通过遵循使用 initContainers 的答案.

I solved a permission issue when mounting /var/lib/postgresql/data by following this answer with initContainers.

现在,我正在尝试将 postgresql.conf 挂载为卷,并且遇到了类似的许可问题,该问题引发了 chown:/var/lib/postgresql/data/postgresql.conf:只读文件系统.

Now I'm trying to mount postgresql.conf as a volume, and I'm running into a similar permissioning issue that throws chown: /var/lib/postgresql/data/postgresql.conf: Read-only file system.

我可能会缺少什么?我已经尝试了很多运气不尽相同的变化.

What could I be missing? I've tried a bunch of different variations with little luck.

apiVersion: apps/v1beta1 kind: StatefulSet metadata: name: postgres labels: app: postgres spec: serviceName: postgres replicas: 1 updateStrategy: type: RollingUpdate template: metadata: labels: app: postgres spec: terminationGracePeriodSeconds: 10 initContainers: - name: chmod-er image: busybox:latest command: - /bin/chown - -R - '0' - /var/lib/postgresql/data volumeMounts: - name: postgredb mountPath: /var/lib/postgresql/data - name: pg-config mountPath: /var/lib/postgresql/data/postgresql.conf subPath: postgresql.conf containers: - name: postgres image: mdillon/postgis:10-alpine ports: - containerPort: 5432 volumeMounts: - name: postgredb mountPath: /var/lib/postgresql/data subPath: data - name: pg-config mountPath: /var/lib/postgresql/data/postgresql.conf subPath: postgresql.conf volumes: - name: postgredb persistentVolumeClaim: claimName: postgres-pvc - name: pg-config configMap: name: pg-config items: - key: postgresql.conf path: postgresql.conf

推荐答案

从kubernetes 1.8开始,configmap只读安装,摘自CHANGELOG-1.8.md:

From kubernetes 1.8 on, configmap is mounted readonly, excerpt from the CHANGELOG-1.8.md:

更改密钥,configMap,downlineAPI和计划的卷以进行挂载只读,而不是允许应用程序写入数据,然后自动还原.在1.11版之前,设置功能Gate ReadOnlyAPIDataVolumes = false将保留旧的行为.(#58720,@ joelsmith)

Changes secret, configMap, downwardAPI and projected volumes to mount read-only, instead of allowing applications to write data and then reverting it automatically. Until version 1.11, setting the feature gate ReadOnlyAPIDataVolumes=false will preserve the old behavior. (#58720, @joelsmith)

如果要更改从configmap挂载的文件,可以将其复制到另一个目录,然后进行更新.

If you want to change the file that mounted from the configmap, you can copy it to another directory, then update it.

更多推荐

chown:/var/lib/postgresql/data/postgresql.conf:只读文件系统

本文发布于:2023-10-15 11:53:16,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1494261.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件系统   lib   var   chown   conf

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!