Repository navigation
Add enableServiceLinks: false - #6
Merged
Merged
Conversation
Service link env vars are a pre-DNS Docker --link copy. They clash with app env vars (REDIS_PORT), slow container start in large namespaces, and list every Service IP to anyone who can read the environment. Move the old README note into a full section. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
The migration check misses unsuffixed variables such as REDIS_PORT.
1 open finding
What changed in this PR
Adds enableServiceLinks: false as a safer Kubernetes Pod default and documents its implications.
Changes:
- Disables service-link environment-variable injection.
- Documents benefits, compatibility concerns, and migration guidance.
| File | Description |
|---|---|
pod.yaml |
Disables service links in the Pod template. |
README.md |
Updates the example and adds service-link guidance. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| Things to know: | ||
|
|
||
| - The `KUBERNETES_SERVICE_HOST` and `KUBERNETES_SERVICE_PORT` variables for the API server are still set. Kubernetes client libraries use them, so in-cluster API access still works. | ||
| - Before you turn this off, search your app's code and config for `_SERVICE_HOST`, `_SERVICE_PORT`, and `_PORT_` variables, and change them to DNS names. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Stack 4/5. Based on PR #5.
What
enableServiceLinks: falsetopod.yaml.Why
Service link env vars are a pre-DNS copy of Docker
--link. They clash with app variables (a Service namedredissetsREDIS_PORT=tcp://...), slow container start in namespaces with many Services, and list every Service IP to anyone who can read the process environment.KUBERNETES_SERVICE_HOST/PORTare still set, so in-cluster API clients still work.Testing
yamllintandmarkdownlintpass with the repo configs in.github/linters/.pod.yaml.🤖 Generated with Claude Code