external-dns icon indicating copy to clipboard operation
external-dns copied to clipboard

feat(chart): optional sidecar on webhook

Open aceeric opened this issue 5 months ago • 22 comments

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

aceeric avatar Jun 29 '25 00:06 aceeric

[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.

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 avatar Jun 29 '25 00:06 k8s-ci-robot

CLA Signed

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:

k8s-ci-robot avatar Jun 29 '25 00:06 k8s-ci-robot

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.

k8s-ci-robot avatar Jun 29 '25 00:06 k8s-ci-robot

/ok-to-test

szuecs avatar Jun 29 '25 21:06 szuecs

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

mloiseleur avatar Jun 29 '25 21:06 mloiseleur

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?

stevehipwell avatar Jun 30 '25 13:06 stevehipwell

I have no strong preferences here, will completely defer the decision on if we want to support his in helm.

Raffo avatar Jun 30 '25 13:06 Raffo

@mloiseleur what do you think?

stevehipwell avatar Jul 14 '25 08:07 stevehipwell

@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

mloiseleur avatar Jul 14 '25 19:07 mloiseleur

@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.

aceeric avatar Jul 15 '25 23:07 aceeric

Folks - I've made the requested mods. (Re-based on master.) Also: I fixed the Helm schema generation as discussed in this issue.

aceeric avatar Jul 27 '25 20:07 aceeric

@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 avatar Aug 14 '25 16:08 stevehipwell

@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 avatar Aug 16 '25 02:08 aceeric

@aceeric I'm saying the existing values need to be kept but deprecated, with the new pattern overriding the old.

stevehipwell avatar Aug 16 '25 06:08 stevehipwell

@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 avatar Aug 18 '25 21:08 aceeric

@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 avatar Aug 19 '25 09:08 stevehipwell

@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 avatar Aug 19 '25 23:08 aceeric

@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 avatar Aug 20 '25 09:08 stevehipwell

@stevehipwell giving it another go...

aceeric avatar Aug 23 '25 00:08 aceeric

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/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was 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

k8s-triage-robot avatar Nov 21 '25 02:11 k8s-triage-robot

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.

k8s-ci-robot avatar Nov 21 '25 02:11 k8s-ci-robot

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/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was 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

k8s-triage-robot avatar Dec 21 '25 02:12 k8s-triage-robot