Kubernetes ingress rules

0 votes

I have a k8s 1.9.0 cluster and following is my ingress rule.

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
 name: my-ingress
 labels:
  app: report
annotations:
  ingress.kubernetes.io/rewrite-target: /
spec:
 rules:
  - host: "gayan.test.com"
    http:
     paths:
      - path: /report
        backend:
         serviceName: qc-report-svc
         servicePort: 80
     - path: /report/*
        backend:
         serviceName: qc-report-svc
         servicePort: 80

So I have two requirements:

https://gayan.test.com/report/ping This request hit the pod and return the response. (GET /ping 200 302.079 ms - 63)

- wss://gayan.test.com/report/socket.io/?EIO=3&transport=websocket. This request doesn't even hit the server. I think this is related to ingress rule.

My question is how can I send all the /report traffic to qc-report-svc service?

Sep 10, 2018 in Kubernetes by lina
• 8,100 points
141 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

Assuming you are using the Nginx Ingress Controller you need to add the nginx.org/websocket-services annotation to enable WebSocket support.

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
 name: my-ingress
 labels:
   app: report
annotations:
  ingress.kubernetes.io/rewrite-target: /
  nginx.org/websocket-services: "qc-report-svc"
spec:
 rules:
  - host: "gayan.test.com"
    http:
     paths:
      - path: /report
        backend:
         serviceName: qc-report-svc
         servicePort: 80
answered Sep 10, 2018 by Kalgi
• 35,750 points

Related Questions In Kubernetes

0 votes
1 answer

Forcing ssl for Kubernetes Ingress on GKE

https://github.com/kubernetes/ingress-gce#frontend-https If you want to block http, you ...READ MORE

answered Sep 6, 2018 in Kubernetes by ajs3033
• 7,000 points
685 views
0 votes
1 answer

Filter source ip in kubernetes ingress in GCE

This feature currently works only with nginx. Example ...READ MORE

answered Sep 7, 2018 in Kubernetes by Kalgi
• 35,750 points
122 views
0 votes
2 answers

single point of entry for multiple services in kubernetes ingress

I tried having something similar too. Deployment apiVersion: extensions/v1beta1 kind: ...READ MORE

answered Sep 7, 2018 in Kubernetes by Hannah
• 14,080 points
43 views
0 votes
1 answer

Customize the routing logic in kubernetes ingress controller

Try building your own customized image based on ...READ MORE

answered Sep 7, 2018 in Kubernetes by Kalgi
• 35,750 points
43 views
0 votes
1 answer
0 votes
3 answers

Error while joining cluster with node

Hi Kalgi after following above steps it ...READ MORE

answered Jan 17 in Others by anonymous
456 views
+3 votes
1 answer
0 votes
2 answers

Deny access to some specific paths while using kubernetes ingress

Try to create two Ingresses first by default ...READ MORE

answered Sep 21, 2018 in Kubernetes by Nilesh
• 6,900 points
394 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.