kubernetes / ingress-nginx

Ingress NGINX Controller for Kubernetes
https://kubernetes.github.io/ingress-nginx/
Apache License 2.0
17.56k stars 8.27k forks source link

Default Backend doesn't work with different namespaces #12369

Closed ama23-lang closed 1 week ago

ama23-lang commented 1 week ago

Hi , I would like to add a default backend annotation to my ingresses nginx.ingress.kubernetes.io/default-backend: . However I will add this annotation to different services in different namespaces and I would like to create a centralized backend to use it each time , it will be more like a customized error backend . It will be so heavy to install the backend each time in the same namespace . Is thee a way to specify the backend and the namespace in the annotation ?

k8s-ci-robot commented 1 week ago

This issue is currently awaiting triage.

If Ingress contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
longwuyuan commented 1 week ago

/remove-kind bug

https://kubernetes.github.io/ingress-nginx/examples/customization/custom-errors/#customized-default-backend

https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#default-backend

/kind support

/close

k8s-ci-robot commented 1 week ago

@longwuyuan: Closing this issue.

In response to [this](https://github.com/kubernetes/ingress-nginx/issues/12369#issuecomment-2475907835): >/remove-kind bug > >https://kubernetes.github.io/ingress-nginx/examples/customization/custom-errors/#customized-default-backend > >https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#default-backend > >/kind support > >/close Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
ama23-lang commented 1 week ago

Hi longwuyuan , I looked at the documentation , however in the documentation the default backend annotation specifies that teh default backend should be in the same namespace as the service's ingress , my problem is , is there a way to use a default backend in another namespace ?

longwuyuan commented 1 week ago

Understood. You have the option to set default-backend uisng flag https://kubernetes.github.io/ingress-nginx/examples/customization/custom-errors/#customized-default-backend

longwuyuan commented 1 week ago

https://kubernetes.github.io/ingress-nginx/examples/customization/custom-errors/#customized-default-backend