K8S 部署nginx 自定义命令参数指定配置文件位置启动失败

YAML

containers:
  - name: nginx-test
    image: 'nginx:alpine-perl'
    command:
      - nginx
    args:
      - '-g daemon off;'
      - '-c /xxx/nginx.conf'

现象

启动报异常

nginx: [emerg] open() “/etc/nginx/ /xxx/nginx.conf” failed (2: No such file or directory)

解决

修改yaml

containers:
  - name: nginx-test
    image: 'nginx:alpine-perl'
    command:
      - nginx
    args:
      - '-g daemon off;'
      - '-c'
      - /xxx/nginx.conf

posted on 2020-12-18 11:42  路过君  阅读(1341)  评论(0编辑  收藏  举报

导航