Kubernetes Ingress: How can I expose two ports on one path?Kubernetes: Updating a Deployment Image with a TLS...

Is camera lens focus an exact point or a range?

Divine apple island

Customize circled numbers

Diode in opposite direction?

Find last 3 digits of this monster number

Will the technology I first learn determine the direction of my future career?

Is a model fitted to data or is data fitted to a model?

How do I implement a file system driver driver in Linux?

What's the difference between 違法 and 不法?

Why is Arduino resetting while driving motors?

What is this type of notehead called?

If a character with the Alert feat rolls a crit fail on their Perception check, are they surprised?

Translation of Scottish 16th century church stained glass

Have I saved too much for retirement so far?

Is XSS in canonical link possible?

How to color a curve

Has Darkwing Duck ever met Scrooge McDuck?

Why did the EU agree to delay the Brexit deadline?

How do I repair my stair bannister?

THT: What is a squared annular “ring”?

How can "mimic phobia" be cured or prevented?

Global amount of publications over time

Can somebody explain Brexit in a few child-proof sentences?

Constructing Group Divisible Designs - Algorithms?



Kubernetes Ingress: How can I expose two ports on one path?


Kubernetes: Updating a Deployment Image with a TLS Ingress ResourceKubernetes Ingress HANGINX vs. GCE Kubernetes ingress classesAutomatically created ingress firewall rules for Google Kubernetes Engine clusterHow to expose and access MongoDb ports in Kubernetes?Kubernetes GCE Ingress cannot find servicesInheritance in Kubernetes Ingress Rule PathUsing kubernetes ingress to expose multiple services, without exposing the services with NodePortGCE NGINX Ingress does not use controllerKubernetes: 502 Bad Gateway for some assets - with Nginx Ingress













0















I have a gce ingress configured and working with SSL on port 443. I'm trying to get port 28080 pointing to my standalone actioncable server:
http://guides.rubyonrails.org/action_cable_overview.html#standalone



I currently have this for my ingress yaml:



# web-ingress.yaml
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: gke-ingress
annotations:
kubernetes.io/ingress.class: "gce"
ingress.kubernetes.io/ssl-redirect: "true"
kubernetes.io/ingress.allow-http: "false"
spec:
rules:
- host: example.com
http:
paths:
- path: /ws
backend:
serviceName: websocket
servicePort: 28080
tls:
- secretName: gkecert
hosts:
- example.com
backend:
serviceName: web
servicePort: 443


If I set the path to / for the websocket service, it screws up the root path (error 503). From what I've read, an ingress cannot handle 2 ports on one path. How then are people connecting their front-ends to websocket servers without separating by path?










share|improve this question














bumped to the homepage by Community 6 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.




















    0















    I have a gce ingress configured and working with SSL on port 443. I'm trying to get port 28080 pointing to my standalone actioncable server:
    http://guides.rubyonrails.org/action_cable_overview.html#standalone



    I currently have this for my ingress yaml:



    # web-ingress.yaml
    apiVersion: extensions/v1beta1
    kind: Ingress
    metadata:
    name: gke-ingress
    annotations:
    kubernetes.io/ingress.class: "gce"
    ingress.kubernetes.io/ssl-redirect: "true"
    kubernetes.io/ingress.allow-http: "false"
    spec:
    rules:
    - host: example.com
    http:
    paths:
    - path: /ws
    backend:
    serviceName: websocket
    servicePort: 28080
    tls:
    - secretName: gkecert
    hosts:
    - example.com
    backend:
    serviceName: web
    servicePort: 443


    If I set the path to / for the websocket service, it screws up the root path (error 503). From what I've read, an ingress cannot handle 2 ports on one path. How then are people connecting their front-ends to websocket servers without separating by path?










    share|improve this question














    bumped to the homepage by Community 6 mins ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      0












      0








      0








      I have a gce ingress configured and working with SSL on port 443. I'm trying to get port 28080 pointing to my standalone actioncable server:
      http://guides.rubyonrails.org/action_cable_overview.html#standalone



      I currently have this for my ingress yaml:



      # web-ingress.yaml
      apiVersion: extensions/v1beta1
      kind: Ingress
      metadata:
      name: gke-ingress
      annotations:
      kubernetes.io/ingress.class: "gce"
      ingress.kubernetes.io/ssl-redirect: "true"
      kubernetes.io/ingress.allow-http: "false"
      spec:
      rules:
      - host: example.com
      http:
      paths:
      - path: /ws
      backend:
      serviceName: websocket
      servicePort: 28080
      tls:
      - secretName: gkecert
      hosts:
      - example.com
      backend:
      serviceName: web
      servicePort: 443


      If I set the path to / for the websocket service, it screws up the root path (error 503). From what I've read, an ingress cannot handle 2 ports on one path. How then are people connecting their front-ends to websocket servers without separating by path?










      share|improve this question














      I have a gce ingress configured and working with SSL on port 443. I'm trying to get port 28080 pointing to my standalone actioncable server:
      http://guides.rubyonrails.org/action_cable_overview.html#standalone



      I currently have this for my ingress yaml:



      # web-ingress.yaml
      apiVersion: extensions/v1beta1
      kind: Ingress
      metadata:
      name: gke-ingress
      annotations:
      kubernetes.io/ingress.class: "gce"
      ingress.kubernetes.io/ssl-redirect: "true"
      kubernetes.io/ingress.allow-http: "false"
      spec:
      rules:
      - host: example.com
      http:
      paths:
      - path: /ws
      backend:
      serviceName: websocket
      servicePort: 28080
      tls:
      - secretName: gkecert
      hosts:
      - example.com
      backend:
      serviceName: web
      servicePort: 443


      If I set the path to / for the websocket service, it screws up the root path (error 503). From what I've read, an ingress cannot handle 2 ports on one path. How then are people connecting their front-ends to websocket servers without separating by path?







      kubernetes google-kubernetes-engine websocket






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jul 22 '18 at 7:36









      ArchonicArchonic

      1336




      1336





      bumped to the homepage by Community 6 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 6 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          1 Answer
          1






          active

          oldest

          votes


















          0














          I think your second Backend service is missing the path, if you want to use ingress with one host and two services you should add the path.
          See ingress fanout then your ingress should be like:



          # web-ingress.yaml
          apiVersion: extensions/v1beta1
          kind: Ingress
          metadata:
          name: gke-ingress
          annotations:
          kubernetes.io/ingress.class: "gce"
          ingress.kubernetes.io/ssl-redirect: "true"
          kubernetes.io/ingress.allow-http: "false"
          spec:
          tls:
          - secretName: gkecert
          hosts:
          - example.com
          rules:
          - host: example.com
          http:
          paths:
          - path: /ws
          backend:
          serviceName: websocket
          servicePort: 28080
          - path: /
          backend:
          serviceName: web
          servicePort: 443



          You must specify the path if you want to use the same host.
          You can connect the front-ends to websocket servers without separating by path using different host.
          See the documentation on how we do it Link







          share|improve this answer
























          • "You can connect the front-ends to websocket servers without separating by path using different host" - That seems to confirm that it's not possible to have two ports go to 2 services on the same path for the same host. The example I gave works, but I was hoping to get the /ws path to /. Your example 404s at / for the web, not sure why.

            – Archonic
            Jul 28 '18 at 19:22











          • My mistake, your example seems to be equivalent to mine, and cleaner. Thought it was 404'ing because it doesn't redirect http to https.

            – Archonic
            Jul 28 '18 at 19:28











          • when it's 404 dafault backend, that mean the rules doesn't apply or there is no rules. ingress only expose the port 80 and 443 to expose other port you need to setup a load balancer like below.

            – Alioua
            Jul 30 '18 at 16:22











          • apiVersion: v1 kind: Service metadata: name: websocket spec: type: LoadBalancer ports: - port: 28080 targetPort: 80080 protocol: TCP selector: name: standalone

            – Alioua
            Jul 30 '18 at 16:23











          • Port 28080 is exposed in the example in the question, it's just the path that bothers me.

            – Archonic
            Jul 31 '18 at 18:32











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "2"
          };
          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',
          autoActivateHeartbeat: false,
          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%2fserverfault.com%2fquestions%2f923023%2fkubernetes-ingress-how-can-i-expose-two-ports-on-one-path%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









          0














          I think your second Backend service is missing the path, if you want to use ingress with one host and two services you should add the path.
          See ingress fanout then your ingress should be like:



          # web-ingress.yaml
          apiVersion: extensions/v1beta1
          kind: Ingress
          metadata:
          name: gke-ingress
          annotations:
          kubernetes.io/ingress.class: "gce"
          ingress.kubernetes.io/ssl-redirect: "true"
          kubernetes.io/ingress.allow-http: "false"
          spec:
          tls:
          - secretName: gkecert
          hosts:
          - example.com
          rules:
          - host: example.com
          http:
          paths:
          - path: /ws
          backend:
          serviceName: websocket
          servicePort: 28080
          - path: /
          backend:
          serviceName: web
          servicePort: 443



          You must specify the path if you want to use the same host.
          You can connect the front-ends to websocket servers without separating by path using different host.
          See the documentation on how we do it Link







          share|improve this answer
























          • "You can connect the front-ends to websocket servers without separating by path using different host" - That seems to confirm that it's not possible to have two ports go to 2 services on the same path for the same host. The example I gave works, but I was hoping to get the /ws path to /. Your example 404s at / for the web, not sure why.

            – Archonic
            Jul 28 '18 at 19:22











          • My mistake, your example seems to be equivalent to mine, and cleaner. Thought it was 404'ing because it doesn't redirect http to https.

            – Archonic
            Jul 28 '18 at 19:28











          • when it's 404 dafault backend, that mean the rules doesn't apply or there is no rules. ingress only expose the port 80 and 443 to expose other port you need to setup a load balancer like below.

            – Alioua
            Jul 30 '18 at 16:22











          • apiVersion: v1 kind: Service metadata: name: websocket spec: type: LoadBalancer ports: - port: 28080 targetPort: 80080 protocol: TCP selector: name: standalone

            – Alioua
            Jul 30 '18 at 16:23











          • Port 28080 is exposed in the example in the question, it's just the path that bothers me.

            – Archonic
            Jul 31 '18 at 18:32
















          0














          I think your second Backend service is missing the path, if you want to use ingress with one host and two services you should add the path.
          See ingress fanout then your ingress should be like:



          # web-ingress.yaml
          apiVersion: extensions/v1beta1
          kind: Ingress
          metadata:
          name: gke-ingress
          annotations:
          kubernetes.io/ingress.class: "gce"
          ingress.kubernetes.io/ssl-redirect: "true"
          kubernetes.io/ingress.allow-http: "false"
          spec:
          tls:
          - secretName: gkecert
          hosts:
          - example.com
          rules:
          - host: example.com
          http:
          paths:
          - path: /ws
          backend:
          serviceName: websocket
          servicePort: 28080
          - path: /
          backend:
          serviceName: web
          servicePort: 443



          You must specify the path if you want to use the same host.
          You can connect the front-ends to websocket servers without separating by path using different host.
          See the documentation on how we do it Link







          share|improve this answer
























          • "You can connect the front-ends to websocket servers without separating by path using different host" - That seems to confirm that it's not possible to have two ports go to 2 services on the same path for the same host. The example I gave works, but I was hoping to get the /ws path to /. Your example 404s at / for the web, not sure why.

            – Archonic
            Jul 28 '18 at 19:22











          • My mistake, your example seems to be equivalent to mine, and cleaner. Thought it was 404'ing because it doesn't redirect http to https.

            – Archonic
            Jul 28 '18 at 19:28











          • when it's 404 dafault backend, that mean the rules doesn't apply or there is no rules. ingress only expose the port 80 and 443 to expose other port you need to setup a load balancer like below.

            – Alioua
            Jul 30 '18 at 16:22











          • apiVersion: v1 kind: Service metadata: name: websocket spec: type: LoadBalancer ports: - port: 28080 targetPort: 80080 protocol: TCP selector: name: standalone

            – Alioua
            Jul 30 '18 at 16:23











          • Port 28080 is exposed in the example in the question, it's just the path that bothers me.

            – Archonic
            Jul 31 '18 at 18:32














          0












          0








          0







          I think your second Backend service is missing the path, if you want to use ingress with one host and two services you should add the path.
          See ingress fanout then your ingress should be like:



          # web-ingress.yaml
          apiVersion: extensions/v1beta1
          kind: Ingress
          metadata:
          name: gke-ingress
          annotations:
          kubernetes.io/ingress.class: "gce"
          ingress.kubernetes.io/ssl-redirect: "true"
          kubernetes.io/ingress.allow-http: "false"
          spec:
          tls:
          - secretName: gkecert
          hosts:
          - example.com
          rules:
          - host: example.com
          http:
          paths:
          - path: /ws
          backend:
          serviceName: websocket
          servicePort: 28080
          - path: /
          backend:
          serviceName: web
          servicePort: 443



          You must specify the path if you want to use the same host.
          You can connect the front-ends to websocket servers without separating by path using different host.
          See the documentation on how we do it Link







          share|improve this answer













          I think your second Backend service is missing the path, if you want to use ingress with one host and two services you should add the path.
          See ingress fanout then your ingress should be like:



          # web-ingress.yaml
          apiVersion: extensions/v1beta1
          kind: Ingress
          metadata:
          name: gke-ingress
          annotations:
          kubernetes.io/ingress.class: "gce"
          ingress.kubernetes.io/ssl-redirect: "true"
          kubernetes.io/ingress.allow-http: "false"
          spec:
          tls:
          - secretName: gkecert
          hosts:
          - example.com
          rules:
          - host: example.com
          http:
          paths:
          - path: /ws
          backend:
          serviceName: websocket
          servicePort: 28080
          - path: /
          backend:
          serviceName: web
          servicePort: 443



          You must specify the path if you want to use the same host.
          You can connect the front-ends to websocket servers without separating by path using different host.
          See the documentation on how we do it Link








          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jul 27 '18 at 19:57









          AliouaAlioua

          2667




          2667













          • "You can connect the front-ends to websocket servers without separating by path using different host" - That seems to confirm that it's not possible to have two ports go to 2 services on the same path for the same host. The example I gave works, but I was hoping to get the /ws path to /. Your example 404s at / for the web, not sure why.

            – Archonic
            Jul 28 '18 at 19:22











          • My mistake, your example seems to be equivalent to mine, and cleaner. Thought it was 404'ing because it doesn't redirect http to https.

            – Archonic
            Jul 28 '18 at 19:28











          • when it's 404 dafault backend, that mean the rules doesn't apply or there is no rules. ingress only expose the port 80 and 443 to expose other port you need to setup a load balancer like below.

            – Alioua
            Jul 30 '18 at 16:22











          • apiVersion: v1 kind: Service metadata: name: websocket spec: type: LoadBalancer ports: - port: 28080 targetPort: 80080 protocol: TCP selector: name: standalone

            – Alioua
            Jul 30 '18 at 16:23











          • Port 28080 is exposed in the example in the question, it's just the path that bothers me.

            – Archonic
            Jul 31 '18 at 18:32



















          • "You can connect the front-ends to websocket servers without separating by path using different host" - That seems to confirm that it's not possible to have two ports go to 2 services on the same path for the same host. The example I gave works, but I was hoping to get the /ws path to /. Your example 404s at / for the web, not sure why.

            – Archonic
            Jul 28 '18 at 19:22











          • My mistake, your example seems to be equivalent to mine, and cleaner. Thought it was 404'ing because it doesn't redirect http to https.

            – Archonic
            Jul 28 '18 at 19:28











          • when it's 404 dafault backend, that mean the rules doesn't apply or there is no rules. ingress only expose the port 80 and 443 to expose other port you need to setup a load balancer like below.

            – Alioua
            Jul 30 '18 at 16:22











          • apiVersion: v1 kind: Service metadata: name: websocket spec: type: LoadBalancer ports: - port: 28080 targetPort: 80080 protocol: TCP selector: name: standalone

            – Alioua
            Jul 30 '18 at 16:23











          • Port 28080 is exposed in the example in the question, it's just the path that bothers me.

            – Archonic
            Jul 31 '18 at 18:32

















          "You can connect the front-ends to websocket servers without separating by path using different host" - That seems to confirm that it's not possible to have two ports go to 2 services on the same path for the same host. The example I gave works, but I was hoping to get the /ws path to /. Your example 404s at / for the web, not sure why.

          – Archonic
          Jul 28 '18 at 19:22





          "You can connect the front-ends to websocket servers without separating by path using different host" - That seems to confirm that it's not possible to have two ports go to 2 services on the same path for the same host. The example I gave works, but I was hoping to get the /ws path to /. Your example 404s at / for the web, not sure why.

          – Archonic
          Jul 28 '18 at 19:22













          My mistake, your example seems to be equivalent to mine, and cleaner. Thought it was 404'ing because it doesn't redirect http to https.

          – Archonic
          Jul 28 '18 at 19:28





          My mistake, your example seems to be equivalent to mine, and cleaner. Thought it was 404'ing because it doesn't redirect http to https.

          – Archonic
          Jul 28 '18 at 19:28













          when it's 404 dafault backend, that mean the rules doesn't apply or there is no rules. ingress only expose the port 80 and 443 to expose other port you need to setup a load balancer like below.

          – Alioua
          Jul 30 '18 at 16:22





          when it's 404 dafault backend, that mean the rules doesn't apply or there is no rules. ingress only expose the port 80 and 443 to expose other port you need to setup a load balancer like below.

          – Alioua
          Jul 30 '18 at 16:22













          apiVersion: v1 kind: Service metadata: name: websocket spec: type: LoadBalancer ports: - port: 28080 targetPort: 80080 protocol: TCP selector: name: standalone

          – Alioua
          Jul 30 '18 at 16:23





          apiVersion: v1 kind: Service metadata: name: websocket spec: type: LoadBalancer ports: - port: 28080 targetPort: 80080 protocol: TCP selector: name: standalone

          – Alioua
          Jul 30 '18 at 16:23













          Port 28080 is exposed in the example in the question, it's just the path that bothers me.

          – Archonic
          Jul 31 '18 at 18:32





          Port 28080 is exposed in the example in the question, it's just the path that bothers me.

          – Archonic
          Jul 31 '18 at 18:32


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Server Fault!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f923023%2fkubernetes-ingress-how-can-i-expose-two-ports-on-one-path%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

          As a Security Precaution, the user account has been locked The Next CEO of Stack OverflowMS...

          Список ссавців Італії Природоохоронні статуси | Список |...

          Українські прізвища Зміст Історичні відомості |...