Open todaygood opened 6 years ago
[root@ose0 headless-service]# oc logs nginx-deployment-5fd7ff6cc9-blrr7
2018/09/08 14:17:26 [warn] 1#1: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:2
nginx: [warn] the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:2
2018/09/08 14:17:26 [emerg] 1#1: mkdir() "/var/cache/nginx/client_temp" failed (13: Permission denied)
nginx: [emerg] mkdir() "/var/cache/nginx/client_temp" failed (13: Permission denied)
手动启动nginx没有问题
[root@ose7 log]# docker run -idt docker.io/nginx
7663254b013f571241b72b810d9baa4169771a60911bfe3d73f32824bb6e0b4e
[root@ose7 log]#
[root@ose7 log]# docker ps -a |grep nginx
7663254b013f docker.io/nginx "nginx -g 'daemon ..." 16 seconds ago Up 16 seconds 80/tcp pensive_poitras
3d0e7e4a78cc docker.io/nginx@sha256:24a0c4b4a4c0eb97a1aabb8e29f18e917d05abfe1b7a7c07857230879ce7d3d3 "nginx -g 'daemon ..." 3 minutes ago Exited (1) 3 minutes ago k8s_nginx_nginx-deployment-5fd7ff6cc9-lvqhg_openshift-web-console_e87cd901-b35f-11e8-8358-5254006ce49c_30
97671594d5fd openshift/origin-pod:v3.9.0 "/usr/bin/pod" 2 hours ago Up 2 hours k8s_POD_nginx-deployment-5fd7ff6cc9-lvqhg_openshift-web-console_e87cd901-b35f-11e8-8358-5254006ce49c_0
[root@ose7 log]# docker logs 3d0e7e4a78cc
2018/09/08 14:19:05 [warn] 1#1: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:2
nginx: [warn] the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:2
2018/09/08 14:19:05 [emerg] 1#1: mkdir() "/var/cache/nginx/client_temp" failed (13: Permission denied)
nginx: [emerg] mkdir() "/var/cache/nginx/client_temp" failed (13: Permission denied)
手动启的nginx 生成client_temp没问题
[root@ose7 log]# docker exec -it 7663254b013f bash
root@7663254b013f:/# ls
bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var
root@7663254b013f:/# cd /var/cache/nginx/
root@7663254b013f:/var/cache/nginx# ls
client_temp fastcgi_temp proxy_temp scgi_temp uwsgi_temp
经 @nicochen 提示是跟 scc相关, 查阅 https://github.com/openshift/openshift-docs/issues/1533
发现nginx 在openshift中跑,需要使用 super-user privileges , RunAsAny
使用这个命令解决
oc adm policy add-scc-to-group anyuid system:authenticated
如何查询policy ?
role, user , group , policy 有哪些关系?
Issue
nginx-deployment-XXX这两个pod启动失败
/var/log/messages