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,220 points
2,024 views

1 answer to this question.

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
• 52,350 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,300 points
4,226 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
• 52,350 points
1,261 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
• 18,520 points
2,701 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
• 52,350 points
1,333 views
+1 vote
1 answer
0 votes
3 answers

Error while joining cluster with node

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

answered Jan 17, 2019 in Others by anonymous
15,477 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,036 views
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
• 7,060 points
12,063 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP