Higress这个问题怎么解决?创建ingress资源,域名->nginx容器->aurora服务,无法通过域名访问到aurora服务(仅修改ingressClassName为nginx ingress controller就可以访问)gateway日志(没有upstream的任何信息):
controller.higress-core日志:
controller.discovery日志(其它名称空间服务也会有这个日志):
ingress资源:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: aurora-web-higress-ing
namespace: aurora-prod
spec:
ingressClassName: ywjkz-higress
ingressClassName: ops-nginx
rules:
- host: aurora-web.xxxxx.com
http:
paths:
- backend:
service:
name: aurora-web-svc
port:
number: 8080
path: /
pathType: Prefix
server {
listen 8080;
server_name aurora-web.xxxxx.com;
location / {
root /usr/share/nginx/html;
add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
try_files $uri $uri/ /index.html;
}
location /goto {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://aurora-svc:8888;
}
location /api {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
rewrite ^/api/(.*)$ /$1 break;
proxy_pass http://aurora-svc:8888;
}
}
你可以先对照这段代码排查一下:https://github.com/alibaba/higress/blob/main/pkg/ingress/kube/ingressv1/controller.go#L1157 此回答整理自钉群“Higress 社区交流 2 群”
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。