kubernetes / ingress-nginx

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

Feature Request: Allow disabling custom-http-errors per ingress #8384

Open aslafy-z opened 2 years ago

aslafy-z commented 2 years ago

When nginx.ingress.kubernetes.io/custom-http-errors is set to string off, overwrite the configmap value with an empty list instead of skipping it.

My current work-around is to use the 418 HTTP code (nginx.ingress.kubernetes.io/custom-http-errors: "418") because my apps aren't using it :wink:

strongjz commented 2 years ago

/good-first-issue /help-wanted /triage accepted /priority backlog

k8s-ci-robot commented 2 years ago

@strongjz: This request has been marked as suitable for new contributors.

Guidelines

Please ensure that the issue body includes answers to the following questions:

For more details on the requirements of such an issue, please see here and ensure that they are met.

If this request no longer meets these requirements, the label can be removed by commenting with the /remove-good-first-issue command.

In response to [this](https://github.com/kubernetes/ingress-nginx/issues/8384): >/good-first-issue >/help-wanted >/triage accepted >/priority backlog 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/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
k8s-triage-robot commented 2 years ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

aslafy-z commented 2 years ago

/remove-lifecycle stale

fernandes-natanael commented 2 years ago

Hello guys, I would like to work on this issue, can you give me more details on what exactly I need to do?

fernandes-natanael commented 2 years ago

/assign

fernandes-natanael commented 2 years ago

/unassign

asim-reza commented 2 years ago

/assign

asim-reza commented 2 years ago

/unassign

DanielViniciusAlves commented 2 years ago

Hi @strongjz and @aslafy-z , I am new to this repository and still trying to understand the workflow of the project, could you help me figure out what to do in this issue?

DanielViniciusAlves commented 2 years ago

/assign

longwuyuan commented 2 years ago

@aslafy-z tht annotation is named aptly and does what it is names as.

If you are looking for a new feature to handle a case where no existing ingress rule matches a incoming http request and as a result instead of the default-backend of the project handling the response, you want your own behaviour, then I think the documented procedure is to create your own image and use that to create a backend to be configured as a default-backend.

Changing an existing annotation that is sort of not named after your desired behaviour does not seem like an improvement. There are several such changes made earlier that has led to unmaintained and unsupportable features and the project is now in a 6 month phase to clean up and stabilize the code.

This is my opinion so lets wait for other comments. But I vote for not doing this change you are proposing. I hope the project steers away from such changes that only one user benefits from and that is not deeply thought over and elaborated.

But I am not a developer so I could be wrong so lets hope there is enough info posted here about a deep dive analysis on how the change you propose is a improvement for a large number of users.

aslafy-z commented 1 year ago

Here's my use case, the platform team offers a nginx ingress controller with a company-branded default-backend and handles 500 errors by default. Some apps may want to overwrite this behavior by disabling the company default-backend all-together for their ingress (e.g.: development phases where they want to see their app outputs even if they are errors). Allowing users to set nginx.ingress.kubernetes.io/custom-http-errors: off might do the trick. Another way would be to add a new annotation like nginx.ingress.kubernetes.io/disable-default-backend: 'true'.

I feel like it would be a great addition but I understand your point, let's keep this issue open and see if it gains traction.

DanielViniciusAlves commented 1 year ago

/unassign

en-vee commented 11 months ago

/assign

I would like to work on this issue. As I am completely new to this workflow, can I please get some guidance on how to go about working on this issue ?

aslafy-z commented 11 months ago

There's an open pull request that address this issue.

/assign