【问题标题】:Kubernetes nginx config read-only file systemKubernetes nginx 配置只读文件系统
【发布时间】:2020-04-02 23:41:01
【问题描述】:

我创建了一个用作 Nginx 代理的 pod。它适用于默认配置,但是当我通过 ConfigMap 添加自定义配置时,它会崩溃。 这是我唯一的日志。

/bin/bash: /etc/nginx/nginx.conf: 只读文件系统

我的部署.yaml

volumeMounts:
      - name: nginx-config
        mountPath: /etc/nginx/nginx.conf
        subPath: nginx.conf
        readOnly: false
  volumes:
  - name: nginx-config
    configMap:
      name: nginx-config

如果可以帮助我在 StackOverflow 上找到 this 答案,但我不明白如何处理这些段落。

【问题讨论】:

标签: nginx kubernetes google-cloud-platform


【解决方案1】:

配置正确。阅读 Nginx Docker 文档发现必须添加command: [ "/bin/bash", "-c", "nginx -g 'daemon off;'" ]

【讨论】:

    猜你喜欢
    • 2018-09-11
    • 1970-01-01
    • 2021-06-02
    • 2012-03-11
    • 1970-01-01
    • 2018-04-10
    • 2012-06-03
    • 2020-04-26
    • 2019-08-23
    相关资源
    最近更新 更多