gpt4 book ai didi

nginx - OpenWhisk Nginx Pod CrashLoopBackOff

转载 作者:行者123 更新时间:2023-12-02 12:07:03 33 4
gpt4 key购买 nike

我是OpenWhisk的新手,在安装过程中遇到了一些困难。
由于Pod中的错误,Ngnix Pod正在CrashLoopBackOff中运行。

2018/07/02 16:14:27 [emerg] 1#1: host not found in resolver "kube-dns.kube-system" in /etc/nginx/nginx.conf:41
nginx: [emerg] host not found in resolver "kube-dns.kube-system" in /etc/nginx/nginx.conf:41

我无法跳入Pod本身,但是我运行了一个Docker容器,其中包含Pod正在使用的相同镜像,并在nginx.conf中进行了查看:
user  nginx;
worker_processes 1;

error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;


events {
worker_connections 1024;
}


http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;

sendfile on;
#tcp_nopush on;

keepalive_timeout 65;

#gzip on;

include /etc/nginx/conf.d/*.conf;
}

当我查看conf.d目录时,我发现了一个default.conf文件,其中server_name设置为localhost:
server {
listen 80;
server_name localhost;

#charset koi8-r;
#access_log /var/log/nginx/log/host.access.log main;

location / {
root /usr/share/nginx/html;
index index.html index.htm;
}

#error_page 404 /404.html;

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}

# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}

# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}

我相信这是造成问题的原因,而kube.dns服务无法解析本地主机。

但是,我不知道如何解决此问题或至少解决该问题。
也许我可以在Ngnix部署中为Pod设置一个静态主机名,然后将该主机名输入到ngnix配置中?

有人可以提供解决方法吗?

非常感谢。

最佳答案

您是否正在使用“在Kubernetes上进行OpenWhisk部署(https://github.com/apache/incubator-openwhisk-deploy-kube)项目?

我怀疑您可能遇到了README.md中描述的Kubernetes错误:

However, multiple minor releases of Kubernetes, including 1.8.9 and 1.9.4 will not work for OpenWhisk due to bugs with volume mount subpaths (see[1]). This bug will surface as a failure when deploying the nginx container.



解决此问题的方法是使用没有卷安装子路径错误的Kubernetes版本。

关于nginx - OpenWhisk Nginx Pod CrashLoopBackOff,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51140356/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com