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

feat: Disable Service Links by default #146

Merged
merged 1 commit into from
Oct 30, 2024
Merged

feat: Disable Service Links by default #146

merged 1 commit into from
Oct 30, 2024

Conversation

mhutter
Copy link
Member

@mhutter mhutter commented Oct 25, 2024

In the default configuration, Kubernetes will inject a bunch of environment variables for each service in the Namespace. The idea is to aid with service discovery, but while they are rarely used in practice, the injected environment variables might interfere that try to determine their configuration from environment variables.

This commit disables this behaviour by default by setting enableServiceLinks: false in the pod specs, but allows users to reenable the links using a label.

Checklist

  • Categorize the PR by setting a good title and adding one of the labels:
    bug, enhancement, documentation, change, breaking, dependency
    as they show up in the changelog
  • Update tests.

In the default configuration, Kubernetes will inject a bunch of
environment variables for each service in the Namespace. The idea is to
aid with service discovery, but while they are rarely used in practice,
the injected environment variables might interfere that try to determine
their configuration from environment variables.

This commit disables this behaviour by default by setting
`enableServiceLinks: false` in the pod specs, but allows users to
reenable the links using a label.

Signed-off-by: Manuel Hutter <[email protected]>
@mhutter mhutter added the enhancement New feature or request label Oct 25, 2024
@mhutter mhutter requested a review from davidgubler October 25, 2024 14:56
@davidgubler
Copy link
Member

LGTM, feel free to merge.

@mhutter
Copy link
Member Author

mhutter commented Oct 30, 2024

Is this a breaking change? 🤔 It affects the current behavior, but one that was probably not used much in the first place (at least never by us)

@davidgubler
Copy link
Member

I thought about that too, but from what I can tell the service links in k8s are largely a legacy feature that isn't/shouldn't be used, so I'd release this as a non-breaking change, even though in theory it could be.

@mhutter mhutter merged commit d879bd8 into master Oct 30, 2024
4 checks passed
@mhutter mhutter deleted the servicelinks branch October 30, 2024 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants