简体   繁体   中英

Kubernetes nginx config read-only file system

I've created a pod that works as Nginx Proxy. It works well with the default configuration but when I add my custom configuration via ConfigMap it crashes. This is the only log I have.

/bin/bash: /etc/nginx/nginx.conf: Read-only file system

My deployment.yaml

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

If could help I've found this answer on StackOverflow but I don't understand how to do those passages.

The config is correct. Reading the Nginx Docker documentation I've found that I have to add command: [ "/bin/bash", "-c", "nginx -g 'daemon off;'" ]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM