Istio Gateway With multiple ports | service is responding only on port 80











up vote
0
down vote

favorite












Hey so I configured gateway for port 80 and 8083 for same domain i-e example.com. Now when I create attributes using below config file everything get up and running.



issue is I am using 8083 in service and virtualService but I get response from service at 80 where on 8083 getting connection timeout.



Unable to understand why service is responding on 80 not 8083. I want to keep both ports in gateway but when define in service and ingress port 8083 it should response on specifically on 8083.



Would appreciate your feedback in this.



apiVersion: v1
data:
my.databag.1: need_triage
kind: ConfigMap
metadata:
name: my-service-env-variables
namespace: api

---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
app: my-service
name: my-service-service-deployment
namespace: api
spec:
replicas: 1
template:
metadata:
annotations:
traffic.sidecar.istio.io/excludeOutboundIPRanges: 0.0.0.0/0
labels:
app: my-service-service-deployment
spec:
containers:
- env:
- name: my.variable
valueFrom:
secretKeyRef:
key: my_token
name: my.variable
envFrom:
- configMapRef:
name: my-service-env-variables
image: imaagepath:tag
name: my-service-pod
ports:
- containerPort: 8080
name: mysvcport
resources:
limits:
cpu: 700m
memory: 1.8Gi
requests:
cpu: 500m
memory: 1.7Gi

---
apiVersion: v1
kind: Service
metadata:
name: my-service
namespace: api
spec:
ports:
- port: 8083
protocol: TCP
targetPort: mysvcport
selector:
app: my-service-service-deployment

---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: my-service-ingress
namespace: api
spec:
gateways:
- http-gateway
hosts:
- my-service.example.com
http:
- route:
- destination:
host: my-service
port:
number: 8083
---
apiVersion: v1
items:
- apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
clusterName: ""
creationTimestamp: 2018-11-07T13:17:00Z
name: http-gateway
namespace: api
resourceVersion: "11778445"
selfLink: /apis/networking.istio.io/v1alpha3/namespaces/api/gateways/http-gateway
uid: 694f66a4-e28f-11e8-bc21-0ac9e31187a0
spec:
selector:
istio: ingressgateway
servers:
- hosts:
- '*.example.com'
port:
name: http
number: 80
protocol: HTTP
- hosts:
- '*.example.com'
port:
name: tomcat-http
number: 8083
protocol: HTTP
kind: List
metadata:
resourceVersion: ""
selfLink: ""









share|improve this question


























    up vote
    0
    down vote

    favorite












    Hey so I configured gateway for port 80 and 8083 for same domain i-e example.com. Now when I create attributes using below config file everything get up and running.



    issue is I am using 8083 in service and virtualService but I get response from service at 80 where on 8083 getting connection timeout.



    Unable to understand why service is responding on 80 not 8083. I want to keep both ports in gateway but when define in service and ingress port 8083 it should response on specifically on 8083.



    Would appreciate your feedback in this.



    apiVersion: v1
    data:
    my.databag.1: need_triage
    kind: ConfigMap
    metadata:
    name: my-service-env-variables
    namespace: api

    ---
    apiVersion: extensions/v1beta1
    kind: Deployment
    metadata:
    labels:
    app: my-service
    name: my-service-service-deployment
    namespace: api
    spec:
    replicas: 1
    template:
    metadata:
    annotations:
    traffic.sidecar.istio.io/excludeOutboundIPRanges: 0.0.0.0/0
    labels:
    app: my-service-service-deployment
    spec:
    containers:
    - env:
    - name: my.variable
    valueFrom:
    secretKeyRef:
    key: my_token
    name: my.variable
    envFrom:
    - configMapRef:
    name: my-service-env-variables
    image: imaagepath:tag
    name: my-service-pod
    ports:
    - containerPort: 8080
    name: mysvcport
    resources:
    limits:
    cpu: 700m
    memory: 1.8Gi
    requests:
    cpu: 500m
    memory: 1.7Gi

    ---
    apiVersion: v1
    kind: Service
    metadata:
    name: my-service
    namespace: api
    spec:
    ports:
    - port: 8083
    protocol: TCP
    targetPort: mysvcport
    selector:
    app: my-service-service-deployment

    ---
    apiVersion: networking.istio.io/v1alpha3
    kind: VirtualService
    metadata:
    name: my-service-ingress
    namespace: api
    spec:
    gateways:
    - http-gateway
    hosts:
    - my-service.example.com
    http:
    - route:
    - destination:
    host: my-service
    port:
    number: 8083
    ---
    apiVersion: v1
    items:
    - apiVersion: networking.istio.io/v1alpha3
    kind: Gateway
    metadata:
    clusterName: ""
    creationTimestamp: 2018-11-07T13:17:00Z
    name: http-gateway
    namespace: api
    resourceVersion: "11778445"
    selfLink: /apis/networking.istio.io/v1alpha3/namespaces/api/gateways/http-gateway
    uid: 694f66a4-e28f-11e8-bc21-0ac9e31187a0
    spec:
    selector:
    istio: ingressgateway
    servers:
    - hosts:
    - '*.example.com'
    port:
    name: http
    number: 80
    protocol: HTTP
    - hosts:
    - '*.example.com'
    port:
    name: tomcat-http
    number: 8083
    protocol: HTTP
    kind: List
    metadata:
    resourceVersion: ""
    selfLink: ""









    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      Hey so I configured gateway for port 80 and 8083 for same domain i-e example.com. Now when I create attributes using below config file everything get up and running.



      issue is I am using 8083 in service and virtualService but I get response from service at 80 where on 8083 getting connection timeout.



      Unable to understand why service is responding on 80 not 8083. I want to keep both ports in gateway but when define in service and ingress port 8083 it should response on specifically on 8083.



      Would appreciate your feedback in this.



      apiVersion: v1
      data:
      my.databag.1: need_triage
      kind: ConfigMap
      metadata:
      name: my-service-env-variables
      namespace: api

      ---
      apiVersion: extensions/v1beta1
      kind: Deployment
      metadata:
      labels:
      app: my-service
      name: my-service-service-deployment
      namespace: api
      spec:
      replicas: 1
      template:
      metadata:
      annotations:
      traffic.sidecar.istio.io/excludeOutboundIPRanges: 0.0.0.0/0
      labels:
      app: my-service-service-deployment
      spec:
      containers:
      - env:
      - name: my.variable
      valueFrom:
      secretKeyRef:
      key: my_token
      name: my.variable
      envFrom:
      - configMapRef:
      name: my-service-env-variables
      image: imaagepath:tag
      name: my-service-pod
      ports:
      - containerPort: 8080
      name: mysvcport
      resources:
      limits:
      cpu: 700m
      memory: 1.8Gi
      requests:
      cpu: 500m
      memory: 1.7Gi

      ---
      apiVersion: v1
      kind: Service
      metadata:
      name: my-service
      namespace: api
      spec:
      ports:
      - port: 8083
      protocol: TCP
      targetPort: mysvcport
      selector:
      app: my-service-service-deployment

      ---
      apiVersion: networking.istio.io/v1alpha3
      kind: VirtualService
      metadata:
      name: my-service-ingress
      namespace: api
      spec:
      gateways:
      - http-gateway
      hosts:
      - my-service.example.com
      http:
      - route:
      - destination:
      host: my-service
      port:
      number: 8083
      ---
      apiVersion: v1
      items:
      - apiVersion: networking.istio.io/v1alpha3
      kind: Gateway
      metadata:
      clusterName: ""
      creationTimestamp: 2018-11-07T13:17:00Z
      name: http-gateway
      namespace: api
      resourceVersion: "11778445"
      selfLink: /apis/networking.istio.io/v1alpha3/namespaces/api/gateways/http-gateway
      uid: 694f66a4-e28f-11e8-bc21-0ac9e31187a0
      spec:
      selector:
      istio: ingressgateway
      servers:
      - hosts:
      - '*.example.com'
      port:
      name: http
      number: 80
      protocol: HTTP
      - hosts:
      - '*.example.com'
      port:
      name: tomcat-http
      number: 8083
      protocol: HTTP
      kind: List
      metadata:
      resourceVersion: ""
      selfLink: ""









      share|improve this question













      Hey so I configured gateway for port 80 and 8083 for same domain i-e example.com. Now when I create attributes using below config file everything get up and running.



      issue is I am using 8083 in service and virtualService but I get response from service at 80 where on 8083 getting connection timeout.



      Unable to understand why service is responding on 80 not 8083. I want to keep both ports in gateway but when define in service and ingress port 8083 it should response on specifically on 8083.



      Would appreciate your feedback in this.



      apiVersion: v1
      data:
      my.databag.1: need_triage
      kind: ConfigMap
      metadata:
      name: my-service-env-variables
      namespace: api

      ---
      apiVersion: extensions/v1beta1
      kind: Deployment
      metadata:
      labels:
      app: my-service
      name: my-service-service-deployment
      namespace: api
      spec:
      replicas: 1
      template:
      metadata:
      annotations:
      traffic.sidecar.istio.io/excludeOutboundIPRanges: 0.0.0.0/0
      labels:
      app: my-service-service-deployment
      spec:
      containers:
      - env:
      - name: my.variable
      valueFrom:
      secretKeyRef:
      key: my_token
      name: my.variable
      envFrom:
      - configMapRef:
      name: my-service-env-variables
      image: imaagepath:tag
      name: my-service-pod
      ports:
      - containerPort: 8080
      name: mysvcport
      resources:
      limits:
      cpu: 700m
      memory: 1.8Gi
      requests:
      cpu: 500m
      memory: 1.7Gi

      ---
      apiVersion: v1
      kind: Service
      metadata:
      name: my-service
      namespace: api
      spec:
      ports:
      - port: 8083
      protocol: TCP
      targetPort: mysvcport
      selector:
      app: my-service-service-deployment

      ---
      apiVersion: networking.istio.io/v1alpha3
      kind: VirtualService
      metadata:
      name: my-service-ingress
      namespace: api
      spec:
      gateways:
      - http-gateway
      hosts:
      - my-service.example.com
      http:
      - route:
      - destination:
      host: my-service
      port:
      number: 8083
      ---
      apiVersion: v1
      items:
      - apiVersion: networking.istio.io/v1alpha3
      kind: Gateway
      metadata:
      clusterName: ""
      creationTimestamp: 2018-11-07T13:17:00Z
      name: http-gateway
      namespace: api
      resourceVersion: "11778445"
      selfLink: /apis/networking.istio.io/v1alpha3/namespaces/api/gateways/http-gateway
      uid: 694f66a4-e28f-11e8-bc21-0ac9e31187a0
      spec:
      selector:
      istio: ingressgateway
      servers:
      - hosts:
      - '*.example.com'
      port:
      name: http
      number: 80
      protocol: HTTP
      - hosts:
      - '*.example.com'
      port:
      name: tomcat-http
      number: 8083
      protocol: HTTP
      kind: List
      metadata:
      resourceVersion: ""
      selfLink: ""






      kubernetes istio






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 8 at 10:49









      Ahsan Naseem

      446215




      446215
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          2
          down vote













          Two issues with your configuration:




          1. You have to call your port http-tomcat and not tomcat-http, see Istio requirements for named ports

          2. In order to enable ingress on port 8083, you have to redeploy the istio-ingressgateway service, with the port 8083 added:

            helm template install/kubernetes/helm/istio/ --name istio-ingressgateway
            --namespace istio-system -x charts/gateways/templates/service.yaml
            --set gateways.istio-egressgateway.enabled=false
            --set gateways.istio-ingressgateway.ports[0].port=80
            --set gateways.istio-ingressgateway.ports[0].name=http
            --set gateways.istio-ingressgateway.ports[1].port=443
            --set gateways.istio-ingressgateway.ports[1].name=https
            --set gateways.istio-ingressgateway.ports[2].port=8083
            --set gateways.istio-ingressgateway.ports[2].name=http-tomcat
            | kubectl apply -f -



          Having said that, do you really have to enable ingress access to the port 8083? You can define some path in the VirtualService for the port 80, e.g. /tomcat/* and direct the incoming traffic from the port 80 to your service on the port 8083.






          share|improve this answer





















          • Hey thanks for response and apologies for getting it back this late. so rather creating istio-ingressgateway service from scratch I edited service using kubectl edit Now this is how istio-gateway service looks like - name: http-tomcat nodePort: 30541 port: 8083 protocol: TCP targetPort: 8083 Also updated gateway of specific namespace as http-tomcat with port 8084 but still same issue service is responding on port 80 but not on 8083
            – Ahsan Naseem
            2 days ago













          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53206158%2fistio-gateway-with-multiple-ports-service-is-responding-only-on-port-80%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          2
          down vote













          Two issues with your configuration:




          1. You have to call your port http-tomcat and not tomcat-http, see Istio requirements for named ports

          2. In order to enable ingress on port 8083, you have to redeploy the istio-ingressgateway service, with the port 8083 added:

            helm template install/kubernetes/helm/istio/ --name istio-ingressgateway
            --namespace istio-system -x charts/gateways/templates/service.yaml
            --set gateways.istio-egressgateway.enabled=false
            --set gateways.istio-ingressgateway.ports[0].port=80
            --set gateways.istio-ingressgateway.ports[0].name=http
            --set gateways.istio-ingressgateway.ports[1].port=443
            --set gateways.istio-ingressgateway.ports[1].name=https
            --set gateways.istio-ingressgateway.ports[2].port=8083
            --set gateways.istio-ingressgateway.ports[2].name=http-tomcat
            | kubectl apply -f -



          Having said that, do you really have to enable ingress access to the port 8083? You can define some path in the VirtualService for the port 80, e.g. /tomcat/* and direct the incoming traffic from the port 80 to your service on the port 8083.






          share|improve this answer





















          • Hey thanks for response and apologies for getting it back this late. so rather creating istio-ingressgateway service from scratch I edited service using kubectl edit Now this is how istio-gateway service looks like - name: http-tomcat nodePort: 30541 port: 8083 protocol: TCP targetPort: 8083 Also updated gateway of specific namespace as http-tomcat with port 8084 but still same issue service is responding on port 80 but not on 8083
            – Ahsan Naseem
            2 days ago

















          up vote
          2
          down vote













          Two issues with your configuration:




          1. You have to call your port http-tomcat and not tomcat-http, see Istio requirements for named ports

          2. In order to enable ingress on port 8083, you have to redeploy the istio-ingressgateway service, with the port 8083 added:

            helm template install/kubernetes/helm/istio/ --name istio-ingressgateway
            --namespace istio-system -x charts/gateways/templates/service.yaml
            --set gateways.istio-egressgateway.enabled=false
            --set gateways.istio-ingressgateway.ports[0].port=80
            --set gateways.istio-ingressgateway.ports[0].name=http
            --set gateways.istio-ingressgateway.ports[1].port=443
            --set gateways.istio-ingressgateway.ports[1].name=https
            --set gateways.istio-ingressgateway.ports[2].port=8083
            --set gateways.istio-ingressgateway.ports[2].name=http-tomcat
            | kubectl apply -f -



          Having said that, do you really have to enable ingress access to the port 8083? You can define some path in the VirtualService for the port 80, e.g. /tomcat/* and direct the incoming traffic from the port 80 to your service on the port 8083.






          share|improve this answer





















          • Hey thanks for response and apologies for getting it back this late. so rather creating istio-ingressgateway service from scratch I edited service using kubectl edit Now this is how istio-gateway service looks like - name: http-tomcat nodePort: 30541 port: 8083 protocol: TCP targetPort: 8083 Also updated gateway of specific namespace as http-tomcat with port 8084 but still same issue service is responding on port 80 but not on 8083
            – Ahsan Naseem
            2 days ago















          up vote
          2
          down vote










          up vote
          2
          down vote









          Two issues with your configuration:




          1. You have to call your port http-tomcat and not tomcat-http, see Istio requirements for named ports

          2. In order to enable ingress on port 8083, you have to redeploy the istio-ingressgateway service, with the port 8083 added:

            helm template install/kubernetes/helm/istio/ --name istio-ingressgateway
            --namespace istio-system -x charts/gateways/templates/service.yaml
            --set gateways.istio-egressgateway.enabled=false
            --set gateways.istio-ingressgateway.ports[0].port=80
            --set gateways.istio-ingressgateway.ports[0].name=http
            --set gateways.istio-ingressgateway.ports[1].port=443
            --set gateways.istio-ingressgateway.ports[1].name=https
            --set gateways.istio-ingressgateway.ports[2].port=8083
            --set gateways.istio-ingressgateway.ports[2].name=http-tomcat
            | kubectl apply -f -



          Having said that, do you really have to enable ingress access to the port 8083? You can define some path in the VirtualService for the port 80, e.g. /tomcat/* and direct the incoming traffic from the port 80 to your service on the port 8083.






          share|improve this answer












          Two issues with your configuration:




          1. You have to call your port http-tomcat and not tomcat-http, see Istio requirements for named ports

          2. In order to enable ingress on port 8083, you have to redeploy the istio-ingressgateway service, with the port 8083 added:

            helm template install/kubernetes/helm/istio/ --name istio-ingressgateway
            --namespace istio-system -x charts/gateways/templates/service.yaml
            --set gateways.istio-egressgateway.enabled=false
            --set gateways.istio-ingressgateway.ports[0].port=80
            --set gateways.istio-ingressgateway.ports[0].name=http
            --set gateways.istio-ingressgateway.ports[1].port=443
            --set gateways.istio-ingressgateway.ports[1].name=https
            --set gateways.istio-ingressgateway.ports[2].port=8083
            --set gateways.istio-ingressgateway.ports[2].name=http-tomcat
            | kubectl apply -f -



          Having said that, do you really have to enable ingress access to the port 8083? You can define some path in the VirtualService for the port 80, e.g. /tomcat/* and direct the incoming traffic from the port 80 to your service on the port 8083.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 8 at 14:15









          Vadim Eisenberg

          1,609188




          1,609188












          • Hey thanks for response and apologies for getting it back this late. so rather creating istio-ingressgateway service from scratch I edited service using kubectl edit Now this is how istio-gateway service looks like - name: http-tomcat nodePort: 30541 port: 8083 protocol: TCP targetPort: 8083 Also updated gateway of specific namespace as http-tomcat with port 8084 but still same issue service is responding on port 80 but not on 8083
            – Ahsan Naseem
            2 days ago




















          • Hey thanks for response and apologies for getting it back this late. so rather creating istio-ingressgateway service from scratch I edited service using kubectl edit Now this is how istio-gateway service looks like - name: http-tomcat nodePort: 30541 port: 8083 protocol: TCP targetPort: 8083 Also updated gateway of specific namespace as http-tomcat with port 8084 but still same issue service is responding on port 80 but not on 8083
            – Ahsan Naseem
            2 days ago


















          Hey thanks for response and apologies for getting it back this late. so rather creating istio-ingressgateway service from scratch I edited service using kubectl edit Now this is how istio-gateway service looks like - name: http-tomcat nodePort: 30541 port: 8083 protocol: TCP targetPort: 8083 Also updated gateway of specific namespace as http-tomcat with port 8084 but still same issue service is responding on port 80 but not on 8083
          – Ahsan Naseem
          2 days ago






          Hey thanks for response and apologies for getting it back this late. so rather creating istio-ingressgateway service from scratch I edited service using kubectl edit Now this is how istio-gateway service looks like - name: http-tomcat nodePort: 30541 port: 8083 protocol: TCP targetPort: 8083 Also updated gateway of specific namespace as http-tomcat with port 8084 but still same issue service is responding on port 80 but not on 8083
          – Ahsan Naseem
          2 days ago




















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53206158%2fistio-gateway-with-multiple-ports-service-is-responding-only-on-port-80%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Schultheiß

          Verwaltungsgliederung Dänemarks

          Liste der Kulturdenkmale in Wilsdruff