首页 文章

具有Istio Ingress的Kubernetes未在标准HTTP端口443/80上运行

提问于
浏览
1

我试图让Kubernetes上的Istio设置为入口控制器 . 问题是我的两个应用程序似乎可以从Istio ingress控制器节点端口(例如,http://[host]:31380/application1http://[host]:31380/application2)访问,但无法从443/80访问 .

我是Kubernetes和Istio的新手,所以我使用https://istio.io/docs/guides/bookinfo/指南作为参考 . 在指南之后相当容易,我能够使用所提到的节点端口访问Bookinfo应用程序 . 我无法从443/80访问它 . 我用舵图安装了Istio . 我也没有在Kubernetes仪表板中看到Ingresses下的任何内容 .

以下是网关/虚拟服务yaml的示例:

apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: myapp-gateway
spec:
  selector:
    istio: ingressgateway # use istio default controller
  servers:
  - port:
      number: 80
      name: http
      protocol: HTTP
    hosts:
    - "*"
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: myapp-virtual-service
spec:
  hosts:
  - "*"
  gateways:
  - myapp-gateway
  http:
  - match:
    - uri:
        prefix: /myapp
    route:
    - destination:
        host: myapp-app-service
        port:
          number: 7080
  - match:
    - uri:
        prefix: /
    route:
    - destination:
        host: kibana
        port:
          number: 5601

关于我要做什么才能让它在443上听的任何想法?我完全错过了一个组件吗?

1 回答

  • 1

    如果需要在443/80上运行到您的应用程序的路由,则您的Kubernetes群集必须部署外部负载均衡器 . 如果不存在,则流量将路由到入口节点端口 .

    请参阅 - https://istio.io/docs/tasks/traffic-management/ingress/#determining-the-ingress-ip-and-ports(确定入口IP和端口):

    "If the EXTERNAL-IP value is set, your environment has an external load balancer that you can use for the ingress gateway. If the EXTERNAL-IP value is (or perpetually ), your environment does not provide an external load balancer for the ingress gateway. In this case, you can access the gateway using the service’s node port."

    没有外部负载均衡器的裸机实例示例:

    [admin@master1 ~]$ kubectl get svc -n istio-system | grep istio-ingress
    istio-ingress              LoadBalancer   10.114.107.196   <pending>     80:32400/TCP,443:31564/TCP                                            5d
    istio-ingressgateway       LoadBalancer   10.99.1.148      <pending>     80:31380/TCP,443:31390/TCP,31400:31400/TCP                            5d
    

    如果要部署到在线 Cloud 提供程序(例如IBM Bluemix(可能是AWS / Azure /等)),则应该已经配置了一个 . 如果您的配置是裸机配置,则可能没有配置负载均衡器 .

    我的带有外部负载均衡器的Bluemix实例的示例:

    λ kubectl get svc -n istio-system | grep istio-ingress
    istio-ingress              LoadBalancer   172.21.26.25     123.45.67.195   80:32000/TCP,443:31694/TCP                                            6h
    istio-ingressgateway       LoadBalancer   172.21.139.142   123.45.67.196   80:31380/TCP,443:31390/TCP,31400:31400/TCP                            6h
    

    我还没有回去将负载均衡器部署到裸机,所以想听听是否有人 . 我简要地看了一下Metal,但没花太多时间 .

相关问题