我有一个集群,我为不同的团队创建了名称空间。然后,我尝试使用这个命令kubectl apply -f ing2_dev_plat.yaml -n namespace_name将一个入口应用到一个命名空间。
之后,引发此错误。如何在多个名称空间中正确配置入口控制器的工作?
Nginx入口contoller服务是默认命名空间。
Error from server (BadRequest): error when creating "ing2_dev_plat.yaml": admission webhook "validate.nginx.ingress.kubernetes.io" denied the request:
-------------------------------------------------------------------------------
Error: exit status 1
2022/02/11 09:17:49 [warn] 3250#3250: the "http2_max_field_size" directive is obsolete, use the "large_client_header_buffers" directive instead in /tmp/nginx-cfg1414424955:143
nginx: [warn] the "http2_max_field_size" directive is obsolete, use the "large_client_header_buffers" directive instead in /tmp/nginx-cfg1414424955:143
2022/02/11 09:17:49 [warn] 3250#3250: the "http2_max_header_size" directive is obsolete, use the "large_client_header_buffers" directive instead in /tmp/nginx-cfg1414424955:144
nginx: [warn] the "http2_max_header_size" directive is obsolete, use the "large_client_header_buffers" directive instead in /tmp/nginx-cfg1414424955:144
2022/02/11 09:17:49 [warn] 3250#3250: the "http2_max_requests" directive is obsolete, use the "keepalive_requests" directive instead in /tmp/nginx-cfg1414424955:145
nginx: [warn] the "http2_max_requests" directive is obsolete, use the "keepalive_requests" directive instead in /tmp/nginx-cfg1414424955:145
2022/02/11 09:17:49 [emerg] 3250#3250: duplicate location "/" in /tmp/nginx-cfg1414424955:1045
nginx: [emerg] duplicate location "/" in /tmp/nginx-cfg1414424955:1045
nginx: configuration file /tmp/nginx-cfg1414424955 test failed

发布于 2022-02-11 14:01:51
正如我在问题下的评论中所说:
nginx: [emerg] duplicate location "/" in /tmp/nginx-cfg1414424955:1045可能表示您已两次定义相同的位置。
如果您在path: /中有任何其他的侵入资源,那么您必须相应地编辑这些信息。
您可以用它们的路径获取所有的侵入资源。
kubectl get ingress -A -o=jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.spec.rules[*].http.paths[*].path}{"\n"}{end}'https://stackoverflow.com/questions/71077745
复制相似问题