GKE NGNIX Ingress to route 2 version of a Web Application Service

119 views
Skip to first unread message

Pankaj Srivastava

unread,
Mar 5, 2022, 3:49:27 AM3/5/22
to Google Cloud Developers
Can I configure NGNIX Ingress in GKE to route 2 version of my Web Application Service?
I have deployed my application twice with different service. one named core-webapp-v1 and another core-webapp-v2. the context of my webapp is /core.
Below is my NGNIX Ingress deployment file. But it is giving me 404 error. Can someone pls help

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: hello-world-ingress
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/ssl-redirect: "false"
    nginx.ingress.kubernetes.io/use-regex: "true"
    nginx.ingress.kubernetes.io/rewrite-target: /$1
spec:
  rules:
  - http:
      paths:
      - path: /api/v1/core(/|$)(.*)
        pathType: Prefix
        backend:
          service:
            name: core-webapp-v1
            port:
              number: 80
      - path: /api/v2/core(/|$)(.*)
        pathType: Prefix
        backend:
          service:
            name: core-webapp-v2
            port:
              number: 80

Thanks & Regards,
Pankaj Srivastava

anikd

unread,
Mar 7, 2022, 8:00:02 PM3/7/22
to Google Cloud Developers

Hello Pankaj,


Can you please make sure you have configured the Nginx Ingress according to the GCP doc[1].


Also, It is worth mentioning that Google Groups is a place for non-technical how-to questions (where you're likely to find information like service status updates and release notes, and ranging from book recommendations to creative shortcuts) [2].

 

Therefore, I would recommend you to consider reaching out to Stack Exchange sites [3] (e.g. Server Fault [4] )where Google also participates that can help you find answers and troubleshoot problems. 


Also I have found a similar thread created on Stack Overflow and that thread is being addressed by community users. I would request you to follow that thread [5]. 

If you find any indication of a GCP specific issue, you may consider reporting [6] the issue with Issue Tracker with all the details [7] (omitting PII/sensitive information). You may also file a case with the GCP Support [8] and we will be more than happy to help. 


Regards

Anik


Reference:


[1]https://cloud.google.com/community/tutorials/nginx-ingress-gke

[2] Discussions: Google Groups: https://cloud.google.com/support/docs/community#discussions_google_groups 

[3] Ask Technical Questions on Stack Exchange Sites: https://cloud.google.com/support/docs/stackexchange 

[4] Server Fault (A question and answer site for deploying and managing IT platforms): https://serverfault.com/questions/tagged/google-cloud-platform 

[5] Stack Overflow (a question and answer site for programmers): https://stackoverflow.com/questions/tagged/google-cloud-platform 

[6] Create new issue: https://cloud.google.com/support/docs/issue-trackers#trackers-list

[7] Report Issues with Issue Trackers: https://cloud.google.com/support/docs/issue-trackers

[8] GCP Support: https://cloud.google.com/support-hub

Reply all
Reply to author
Forward
0 new messages