-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
consistently fallback to default certificate when TLS is configured #2972
Conversation
/assign @aledbf |
/lgtm |
/hold |
Codecov Report
@@ Coverage Diff @@
## master #2972 +/- ##
==========================================
- Coverage 47.58% 47.52% -0.06%
==========================================
Files 77 77
Lines 5634 5639 +5
==========================================
- Hits 2681 2680 -1
- Misses 2600 2607 +7
+ Partials 353 352 -1
Continue to review full report at Codecov.
|
/hold cancel |
/lgtm |
[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 |
What this PR does / why we need it:
Currently having TLS configured in an Ingress Spec does not guarantee that Nginx will be configured using SSL endpoint. Whenever TLS configured we first check the following three edge cases:
SSLCert
for the given server. This means the controller configures Nginx using HTTP endpoint onlySSLCert
for the server. This again means the controller configures Nginx using HTTP endpoint onlyIf everything is good we then use the configured certificate and configure Nginx with HTTPS endpoint.
As you can see there's inconsistency here. One option to resolve this inconsistency would be to make the edge case 1. to behave as other two, a.k.a always fallback to configuring HTTP endpoint only even though user has TLS Spec configured in their Ingress manifest. In my understanding doing this would be breaking the protocol between user and the ingress controller - what I mean is as a user when I include TLS Spec in my Ingress manifest I expect to have my server configured with HTTPS endpoint and have HTTP requests redirected to that endpoint (unless I explicitly opt-out). And I'd also expect the controller to follow the notion of default certificate it has and when there's an issue with the configured certificate (one of the three edge cases above) fallback to using the default certificate.
Another problem with this option is that we won't be able to handle certificate updates dynamically (#2965). Because with this option when user fixes their certificate (i.e edge case 2: user creates the missing secret) we would have to update Nginx configuration and include
listen 443 ssl ...
directive and others. Which means there's no way we can avoid reload.Given above, this PR suggests to change the way controller handles edge cases 2. and 3. With this PR in all the edge cases where we can not successfully configure certificate we fallback to using default certificate. This solves all the issues mentioned above.
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: