如何为istio Ingress网关添加自定义端口? [英] How to add custom port for istio ingress gateway?
问题描述
我是istio的新手.我有一个简单的入口网关yaml文件,侦听端口为26931,但是在应用yaml之后,端口26931不会出现在入口网关公开的端口集中.那么我是否缺少一些必要的步骤或其他内容?
I'm new to istio. I have a simple ingress gateway yaml file, and the listenling port is 26931, but after I applied the yaml, the port 26931 does not appear in the set of ports which ingress gateway expose. So am I lack of some necessary step or something else?
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: batman-gateway
spec:
selector:
istio: ingressgateway
servers:
- port:
number: 26931
name: http
protocol: HTTP
hosts:
- "*"
推荐答案
您不是通过Gateway对象而是通过istio-ingressgateway服务公开端口.
You are exposing ports not with Gateway object, but with istio-ingressgateway service.
kubectl edit svc istio-ingressgateway -n istio-system
因此,如果要公开端口26931,则应使用网关服务
So if you want to expose port 26931, you should do it with gateway service
ports:
- name: http
nodePort: 30001
port: 26931
protocol: TCP
targetPort: 80
还对您以前的帖子发表了评论-如何在istio中配置入口网关?
Also commented on your previous post- How to configure ingress gateway in istio?
这篇关于如何为istio Ingress网关添加自定义端口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!