应用 Ingress 资源时出现错误:区域太小

huangapple go评论66阅读模式
英文:

Getting error while apply ingress resource: zone is too small

问题

我是Kubernetes的新手。我已经创建了一个简单的集群,其中包括1个主节点和1个工作节点(分别在2个不同的虚拟机上运行)。此外,还在一个单独的虚拟机上设置了HA代理。

  1. 客户端版本:v1.24.0
  2. Kustomize版本:v4.5.4
  3. 服务器版本:v1.26.1

我使用清单设置了NGINX Ingress控制器(https://docs.nginx.com/nginx-ingress-controller/installation/installation-with-manifests/)。当我尝试应用带有规则的Ingress资源时,我遇到了错误:

  1. 添加或更新了default/i1的配置;但未应用:重新加载NGINX时出错,错误为default/i1nginx重新加载失败:命令/usr/sbin/nginx -s reload -e stderr stdout: "" stderr: "2023/02/06 12:49:28 [emerg] 30#30: zone \"default-i1-sim.daniyar.uk-first-web-app-service-80\"在/etc/nginx/conf.d/default-i1.conf:4中太小\n"完成时出现错误:退出状态1

我的Ingress资源:

  1. apiVersion: networking.k8s.io/v1
  2. kind: Ingress
  3. metadata:
  4. name: i1
  5. spec:
  6. rules:
  7. - host: sim.daniyar.uk
  8. http:
  9. paths:
  10. - pathType: Prefix
  11. path: /
  12. backend:
  13. service:
  14. name: first-web-app-service
  15. port:
  16. number: 80

IngressClass yaml:

  1. apiVersion: networking.k8s.io/v1
  2. kind: IngressClass
  3. metadata:
  4. name: nginx
  5. annotations:
  6. ingressclass.kubernetes.io/is-default-class: "true"
  7. spec:
  8. controller: nginx.org/ingress-controller

如果需要更多信息,请告诉我。

谢谢

英文:

I am new to Kubernetes. I have create simple cluster with 1 master and 1 worker nodes(both running in 2 different VMs). Additionally there is HA proxy setup in a separate VM.

  1. Client Version: v1.24.0
  2. Kustomize Version: v4.5.4
  3. Server Version: v1.26.1

I have setup NGINX ingress controller using manifests(https://docs.nginx.com/nginx-ingress-controller/installation/installation-with-manifests/).
When I try to apply ingress resource with rules I am getting the error:

  1. Configuration for default/i1 was added or updated ; but was not applied: error reloading NGINX for default/i1: nginx reload failed: command /usr/sbin/nginx -s reload -e stderr stdout: "" stderr: "2023/02/06 12:49:28 [emerg] 30#30: zone \"default-i1-sim.daniyar.uk-first-web-app-service-80\" is too small in /etc/nginx/conf.d/default-i1.conf:4\n" finished with error: exit status 1

My ingress resource:

  1. apiVersion: networking.k8s.io/v1
  2. kind: Ingress
  3. metadata:
  4. name: i1
  5. spec:
  6. rules:
  7. - host: sim.daniyar.uk
  8. http:
  9. paths:
  10. - pathType: Prefix
  11. path: /
  12. backend:
  13. service:
  14. name: first-web-app-service
  15. port:
  16. number: 80

IngressClass yaml:

  1. apiVersion: networking.k8s.io/v1
  2. kind: IngressClass
  3. metadata:
  4. name: nginx
  5. annotations:
  6. ingressclass.kubernetes.io/is-default-class: "true"
  7. spec:
  8. controller: nginx.org/ingress-controller

Let me know if you need more info

Thanks

答案1

得分: 1

找到解决方案。

在我的情况下,我必须通过在我的Ingress资源文件中使用注释来禁用NGINX配置中的区域:

  1. nginx.org/upstream-zone-size: "0"
英文:

Found a solution.

In my case I had to disable zones in NGINX config by using annotation:

  1. nginx.org/upstream-zone-size: "0"

in my ingress resource file.

huangapple
  • 本文由 发表于 2023年2月6日 21:07:03
  • 转载请务必保留本文链接:https://go.coder-hub.com/75361713.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定