feat(chart): optional sidecar on webhook
What does it do ?
It's possible to run the webhook outside the cluster. See https://github.com/kubernetes-sigs/external-dns/issues/5585.
Motivation
In my particular environment, I run the webhook outside the cluster and so the webhook sidecar is un-needed.
More
- [ ] Yes, this PR title follows Conventional Commits
- [ ] Yes, I added unit tests
- [X] Yes, I updated end user documentation accordingly
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please assign stevehipwell for approval. For more information see the Code Review Process.
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
The committers listed above are authorized under a signed CLA.
- :white_check_mark: login: aceeric / name: Eric Ace (333f098be22dd25f28251749f0f56d3995543b54, 385ec41b4c1380955387b2f8d5100b4f8df3dd3c, 552d115a93bed5b8b6ebd5a930d4329614e60620)
Welcome @aceeric!
It looks like this is your first PR to kubernetes-sigs/external-dns 🎉. 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-sigs/external-dns 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 @aceeric. Thanks for your PR.
I'm waiting for a kubernetes-sigs 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-sigs/prow repository.
/ok-to-test
At first glance, I do not see the interest to add an option for only one person in the world. But maybe I missed something. I'm putting this PR on hold, waiting for the discussion on linked issue /hold
FYI this was discussed when the chart was first updated to support the sidecar and it was decided to to support this. I'll second the request to open an issue if you want to discuss this, for architectural changes we much prefer an issue over a PR for this. @mloiseleur correct me if I'm wrong but I think ExternalDNS does support this if you provide your own manifests?
I have no strong preferences here, will completely defer the decision on if we want to support his in helm.
@mloiseleur what do you think?
@stevehipwell This is a valid and interesting use case. It seems there are now two known users with this needs.
/hold cancel /retitle feat(chart): optional sidecar on webhook
@stevehipwell just to confirm - basically all of the keys under the current provider.webhook will indent under provider.webhook.sidecar (comments & defaults removed for clarity):
provider:
name:
webhook:
url:
readTimeout:
writeTimeout:
sidecar:
image:
repository:
tag:
pullPolicy:
env:
args:
extraVolumeMounts:
resources:
securityContext:
livenessProbe:
etc...
readinessProbe:
etc...
service:
port:
serviceMonitor:
interval:
scheme:
tlsConfig:
bearerTokenFile:
scrapeTimeout:
metricRelabelings:
relabelings:
Just confirming before making the mod thanks.
Folks - I've made the requested mods. (Re-based on master.) Also: I fixed the Helm schema generation as discussed in this issue.
@aceeric we need to keep the old values unless we want to make this a breaking change, I think we probably want to keep this as just a patch even if we release a breaking change for the next binary release.
@stevehipwell Thank you. I think you're saying to revert the PR to the initial commit wherein the change was (essentially) non-breaking. E.g. values from:
provider:
name: aws
webhook:
image:
(etc.)
To:
provider:
name: aws
webhook:
sidecar: true/false <------added
image:
(etc.)
Please confirm, thank you.
@aceeric I'm saying the existing values need to be kept but deprecated, with the new pattern overriding the old.
@stevehipwell Thanks. Supporting both current and new values together will require the chart to handle four use cases. Even though one use case is still not supported the chart still needs to be able to differentiate among them.
| # | want sidecar? | using which values? |
|---|---|---|
| 1 | Yes | deprecated |
| 2 | Yes | new |
| 3 | No | deprecated (not supported - backward compatible) |
| 4 | No | new |
One way to do this is to introduce a new variable under the new sidecar variable:
provider:
webhook:
sidecar:
enabled: true/false
The implementation then would be:
| # | want sidecar? | using which values? | Helm values |
|---|---|---|---|
| 1 | Yes | deprecated | provider.name=webhook && provider.webhook.sidecar=null |
| 2 | Yes | new | provider.name=webhook && provider.webhook.sidecar.enabled=true |
| 3 | No | deprecated | Not supported (backward compatible) |
| 4 | No | new | provider.name=webhook && provider.webhook.sidecar.enabled=false |
In summary - out of the box the chart will prefer the new sidecar vars but the deprecated functionality can be enabled by setting the sidecar variable to null.
Please let me know your thoughts or recommend an alternate approach. Thanks again.
@aceeric you should be able to use functions like coalesce & default to combine the new value with the deprecated value in a non-breaking way. This looks like a good case for writing unit tests.
@stevehipwell Thank you. Then the logic to include or exclude the sidecar container will be:
If webhook.sidecar.image.repository (new value) is null and webhook.image.repository (deprecated value) is null
no sidecar
else
sidecar with either new or deprecated values, with new having precedence
@aceeric I'd suggest adding a new provider.webhook.sidecar.enabled value defaulting to true to control if the webhook is in sidecar or external mode when the provider is set to webhook.
@stevehipwell giving it another go...
The Kubernetes project currently lacks enough contributors to adequately respond to all 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:
- Mark this PR as fresh with
/remove-lifecycle stale - Close this PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
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-sigs/prow repository.
The Kubernetes project currently lacks enough active contributors to adequately respond to all 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:
- Mark this PR as fresh with
/remove-lifecycle rotten - Close this PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten