Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add custom port for istio ingress gateway?

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:
    - "*"
like image 658
leo Avatar asked Jun 19 '19 06:06

leo


People also ask

Which resource can we use to configure the Istio ingress Gateway?

Configure the IBM Cloud Kubernetes Service Application Load Balancer to direct traffic to the Istio Ingress gateway with mutual TLS.

Can we have multiple Istio Gateways?

In episode 4, we will talk about how to deploy multiple Istio ingress gateways. Running more than one Istio ingress gateway allows for more complex scenarios. For example, running a separate internal gateway and a public gateway, or running separate gateways based on the hosts.

Can we use Istio as API Gateway?

In the Istio service mesh, you can use a variety of Kubernetes Ingress Controllers to act as entry gateways, but of course, you can also use Istio's built-in Istio Gateway directly, for policy control, traffic management, and usage monitoring.


2 Answers

You are exposing ports not with Gateway object, but with istio-ingressgateway service.

kubectl edit svc istio-ingressgateway -n istio-system

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

Also commented on your previous post- How to configure ingress gateway in istio?

like image 114
A_Suh Avatar answered Oct 13 '22 16:10

A_Suh


The port setup is done in the Helm subchart for gateways. Instead of editing the service directly, you can declaratively define the additional ports in the Istio's values.yaml as something like below.

NOTE: As of Istio v1.2 and v1.3.0, the default port list defined in the original subchart would be overridden by this. In order to keep the default untouched, the below snippet has some values hard copied.

gateways:
  istio-ingressgateway:
    ports:
      # Default port list copied from the original subchart values
      # Ref: https://github.com/istio/istio/blob/release-1.2/install/kubernetes/helm/istio/charts/gateways/values.yaml
      #      (the ports below override the default and do not get merged, and thus need to be copied here)
      - port: 15020
        targetPort: 15020
        name: status-port
      - port: 80
        targetPort: 80
        name: http2
        nodePort: 31380
      - port: 443
        name: https
        nodePort: 31390
      - port: 15029
        targetPort: 15029
        name: https-kiali
      - port: 15030
        targetPort: 15030
        name: https-prometheus
      - port: 15031
        targetPort: 15031
        name: https-grafana
      - port: 15032
        targetPort: 15032
        name: https-tracing
        # This is the port where sni routing happens
      - port: 15443
        targetPort: 15443
        name: tls
      ##=== Additional Ports =======================##
      - port: 8080
        targetPort: 8080
        name: http-custom
      - port: 8081
        targetPort: 8081
        name: http-custom-backup
      ##____________________________________________##
like image 22
Ryota Avatar answered Oct 13 '22 17:10

Ryota