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

do not require --default-backend-service #3126

Merged
merged 2 commits into from
Sep 26, 2018
Merged

do not require --default-backend-service #3126

merged 2 commits into from
Sep 26, 2018

Conversation

ElvinEfendi
Copy link
Member

@ElvinEfendi ElvinEfendi commented Sep 25, 2018

What this PR does / why we need it:
At this time the PR is mainly to foster discussion around the necessity of default-backend-service.
The idea is not everyone requires custom default backend and it should not be ingress-nginx's concern to provide a sophisticated default backend. What I'm suggesting in this PR is to make default-backend-service optional. When it is not given then ingress-nginx returns 404 directly from Nginx. When configured then the existing behaviour is held.

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #

Special notes for your reviewer:

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Sep 25, 2018
@aledbf
Copy link
Member

aledbf commented Sep 25, 2018

What I'm suggesting in this PR is to make default-backend-service optional.

This approach lgtm

@aledbf
Copy link
Member

aledbf commented Sep 25, 2018

The original reason for the default backend was related to the limitation of providing a default route when no valid servers were found.

@jonpulsifer
Copy link
Contributor

I understand this is [WIP], but what else needs to be done so we can :shipit: ? The reason for #3125 was an inadvertent information disclosure of the /metrics endpoint -- which resulted in that (now closed) PR

@aledbf
Copy link
Member

aledbf commented Sep 25, 2018

@jonpulsifer pass the tests

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 26, 2018
@@ -584,6 +584,17 @@ http {

{{ end }}

# backend for when default-backend-service is not configured or it does not have endpoints
server {
listen {{ $all.ListenPorts.Default }} default_server {{ if $all.Cfg.ReusePort }}reuseport{{ end }} backlog={{ $all.BacklogSize }};
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kind of repurposed this $all.ListenPorts.Default, I don't see it being used anywhere else.

@ElvinEfendi ElvinEfendi changed the title [WIP] do not require --default-backend-service do not require --default-backend-service Sep 26, 2018
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 26, 2018
@ElvinEfendi
Copy link
Member Author

The PR is ready now.

@aledbf
Copy link
Member

aledbf commented Sep 26, 2018

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 26, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aledbf, ElvinEfendi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit c3ce6b8 into kubernetes:master Sep 26, 2018
@Rude-Monkey
Copy link

Hello!

I'm not very familiar with Ingress-nginx yet, but shouldn't you build a new Docker image for Ingress-nginx to use with the mandatory.yaml file?

My Ingress-nginx pod won't launch because it's missing a default backend now that the deployment file has been changed. Since the Ingress-nginx code has been changed, I would expect that same deployment file not to be using the same Docker image as before.

Please tell me if I'm missing anything here =)

@aledbf
Copy link
Member

aledbf commented Sep 26, 2018

@Rude-Monkey apologies for this. The deployment files should be updated after the release.
I just merged a PR to fix this issue.

@ElvinEfendi ElvinEfendi deleted the optional-default-backend-service branch September 26, 2018 13:34
@Rude-Monkey
Copy link

Thanks @aledbf !

No problem at all. =D
I was starting to panick a little as I was already investigating an issue with the /deploy/provider/aws/service-nlb.yaml file when applied to a cluster created on AWS using kops with the ingress-nginx service not being correctly created.

k8s-ci-robot pushed a commit to helm/charts that referenced this pull request Jul 25, 2019
In fact,  default-backend-service is not required. See kubernetes/ingress-nginx#3126

Signed-off-by: zhanglei <[email protected]>
gypsydiver pushed a commit to gypsydiver/charts that referenced this pull request Jul 25, 2019
In fact,  default-backend-service is not required. See kubernetes/ingress-nginx#3126

Signed-off-by: zhanglei <[email protected]>
medyagh pushed a commit to medyagh/minikube that referenced this pull request Aug 1, 2019
It's not needed since nginx 0.20.0.

See the following pull-requests for context:
* kubernetes/ingress-nginx#3126
* kubernetes/ingress-nginx#3156
medyagh pushed a commit to medyagh/minikube that referenced this pull request Aug 1, 2019
It's not needed since nginx 0.20.0.

See the following pull-requests for context:
* kubernetes/ingress-nginx#3126
* kubernetes/ingress-nginx#3156
ThoTischner pushed a commit to bitsbeats/charts that referenced this pull request Aug 13, 2019
In fact,  default-backend-service is not required. See kubernetes/ingress-nginx#3126

Signed-off-by: zhanglei <[email protected]>
landorg pushed a commit to landorg/charts that referenced this pull request Aug 19, 2019
In fact,  default-backend-service is not required. See kubernetes/ingress-nginx#3126

Signed-off-by: zhanglei <[email protected]>
Signed-off-by: Roland Gritzer <[email protected]>
kengou pushed a commit to kengou/charts that referenced this pull request Sep 18, 2019
In fact,  default-backend-service is not required. See kubernetes/ingress-nginx#3126

Signed-off-by: zhanglei <[email protected]>
ramkumarvs pushed a commit to yugabyte/charts-helm-fork that referenced this pull request Sep 30, 2019
In fact,  default-backend-service is not required. See kubernetes/ingress-nginx#3126

Signed-off-by: zhanglei <[email protected]>
gaida pushed a commit to gaida/charts that referenced this pull request Oct 3, 2019
In fact,  default-backend-service is not required. See kubernetes/ingress-nginx#3126

Signed-off-by: zhanglei <[email protected]>
dmitry-j-mikhin pushed a commit to dmitry-j-mikhin/ingress-chart that referenced this pull request Feb 27, 2020
In fact,  default-backend-service is not required. See kubernetes/ingress-nginx#3126

Signed-off-by: zhanglei <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants