ingress-nginx
ingress-nginx copied to clipboard
allow proxy-ssl-* annotations without proxy-ssl-secret
Allow the various proxy-ssl-* directives to be set independently.
What this PR does / why we need it:
Currently they are only applied if proxy-ssl-secret is set. However, not all proxy backends require mTLS, so making such a secret in this cases does not make any sense.
Types of changes
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
Which issue/s this PR fixes
fixes #6728
How Has This Been Tested?
Checklist:
- [x] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [x] I've read the CONTRIBUTION guide
- [x] I have added tests to cover my changes.
- [ ] All new and existing tests passed.
Welcome @rittneje!
It looks like this is your first PR to kubernetes/ingress-nginx 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.
You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.
You can also check if kubernetes/ingress-nginx has its own contribution guidelines.
You may want to refer to our testing guide if you run into trouble with your tests not passing.
If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!
Thank you, and welcome to Kubernetes. :smiley:
Hi @rittneje. Thanks for your PR.
I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.
Once the patch is verified, the new status will be reflected by the ok-to-test label.
I understand the commands that are listed here.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: rittneje
To complete the pull request process, please assign elvinefendi after the PR has been reviewed.
You can assign the PR to them by writing /assign @elvinefendi in a comment when ready.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
Hi,
Is this intended to be a draft?
@rikatz To be honest, I don't remember why I did that. Let me open it up for review.
/ok-to-test
@rikatz Is there something I need to do at this point?
@rittneje nothing to do at this point, I still need to review this. It's on my queue, I've been focused on fixing some bug fixes to make the v1 release together with k8s v1.22, and will come back to PR queue as soon as that one is released
Also, so far I've already missed some e2e tests in https://github.com/kubernetes/ingress-nginx/blob/main/test/e2e/annotations/proxyssl.go as well :)
@rittneje Reminder for adding some e2e tests
@rikatz @iamNoah1 Can you clarify what exactly those tests are doing? It seems like they just validate the nginx config file, is that correct?
I'm assuming you are looking for the following test cases:
- proxy-ssl-verify=off
- proxy-ssl-verify=on, proxy-ssl-secret set
- proxy-ssl-verify=on, proxy-ssl-verify-depth set
- proxy-ssl-ciphers set
- protoxy-ssl-protocols set
So what we expect with tests are:
- That no new configuration in template breaks the proxy (aka panics Nginx or places any wrong configuration in nginx.conf)
- That the desired configuration actually works
For the first step, we need to verify that ingress nginx is up, running and the configuration exists in the correct location. You can see some example in:
https://github.com/kubernetes/ingress-nginx/blob/main/test/e2e/annotations/affinity.go#L51-L54
For the second one, we need to CALL nginx and receive the right answer:
https://github.com/kubernetes/ingress-nginx/blob/main/test/e2e/annotations/affinity.go#L56-L60
Both are examples, but we need those tests for all the scenarios :)
@rittneje friendly ping
@rittneje: PR needs rebase.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
This is an important fix, because the workaround of specifying proxy-ssl-secret isn't easy to use with large CA bundles that don't fit into a k8s secret, such as a system CA bundle (~200KB).
Friendly ping @rittneje. Also @EronWright we are super happy for any contribution, in case you want to follow up on the rittnejes work :)
Someone else will have to complete this.
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:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle stale - Mark this issue or PR as rotten with
/lifecycle rotten - Close this issue or PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle rotten - Close this issue or PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the PR is closed
You can:
- Reopen this PR with
/reopen - Mark this PR as fresh with
/remove-lifecycle rotten - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/close
@k8s-triage-robot: Closed this PR.
In response to this:
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied- After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied- After 30d of inactivity since
lifecycle/rottenwas applied, the PR is closedYou can:
- Reopen this PR with
/reopen- Mark this PR as fresh with
/remove-lifecycle rotten- Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/close
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.