Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ingress Controller Path and Rewrites #6017

Open
jsebastianmal opened this issue Jul 12, 2024 · 3 comments
Open

Ingress Controller Path and Rewrites #6017

jsebastianmal opened this issue Jul 12, 2024 · 3 comments
Labels
waiting for response Waiting for author's response

Comments

@jsebastianmal
Copy link

I currently have an ingress driver installed on my EKS cluster where it created a Route 53 record with ACM and pointed it to my NLB and it works fine; I have created a deployment (Castlemock) and its service and when I do a portforward it works fine, but I create my ingress resource like the one attached below and it does not work, when I do a portforward castlemock works with localhost:8080/castlemock

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /castlemock
  name: approot
  namespace: sebas
spec:
  ingressClassName: nginx
  rules:
  - host: castlemock.dev.XXXXXX.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: castlemock
            port: 
              number: 80

and I get in the browser ERR_TOO_MANY_REDIRECTS

Thanks everyone for your help

greetings..

Copy link

Hi @jsebastianmal thanks for reporting!

Be sure to check out the docs and the Contributing Guidelines while you wait for a human to take a look at this 🙂

I've parsed the text of your issue and it looks like you might be mixing up the two Ingress Controllers, please take a look at this page to see the differences between nginxinc/kubernetes-ingress (this repo) and kubernetes/ingress-nginx.

Cheers!

@brianehlert
Copy link
Collaborator

If using this project (the implementation from this GitHub repo) please use this annotation for rewrite:
nginx.org/rewrites

https://github.com/nginxinc/kubernetes-ingress/tree/v3.6.1/examples/ingress-resources/rewrites

https://docs.nginx.com/nginx-ingress-controller/configuration/ingress-resources/advanced-configuration-with-annotations/#request-uriheader-manipulation

If you are using the NGINX Ingress Controller maintained by the Kubernetes community, that is here: https://github.com/kubernetes/ingress-nginx

@vepatel
Copy link
Contributor

vepatel commented Jul 15, 2024

Hi @jsebastianmal , as @brianehlert mentioned please use the annotations matching the project you're using, nginx.ingress.kubernetes.io/rewrite-target: isn't a valid annotation for this project.
Also please provide all the detailed asked for in issue template including NIC version, Plus/OSS and platform etc.
thanks!

@vepatel vepatel added the waiting for response Waiting for author's response label Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for response Waiting for author's response
Projects
Status: Todo ☑
Development

No branches or pull requests

3 participants