Skip to content

Add enableServiceLinks: false - #6

Merged
BretFisher merged 1 commit into
feat/no-sa-tokenfrom
feat/disable-service-links
Oct 7, 2026
Merged

BretFisher merged 1 commit into
feat/no-sa-tokenfrom
feat/disable-service-links

Conversation

@BretFisher

@BretFisher BretFisher commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

Stack 4/5. Based on PR #5.

What

  • Adds enableServiceLinks: false to pod.yaml.
  • Adds a Service links section to the README and removes the old one-line note.

Why

Service link env vars are a pre-DNS copy of Docker --link. They clash with app variables (a Service named redis sets REDIS_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/PORT are still set, so in-cluster API clients still work.

Testing

  • yamllint and markdownlint pass with the repo configs in .github/linters/.
  • A script checks that the README spec block matches pod.yaml.
  • Not tested on a cluster yet.

🤖 Generated with Claude Code

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>
@BretFisher
BretFisher added this pull request to stack #8 October 7, 2026 15:17
@BretFisher
BretFisher marked this pull request as ready for review October 7, 2026 15:33
Copilot AI balanced review requested due to automatic review settings October 7, 2026 15:33
@BretFisher
BretFisher merged commit 2ed4e80 into main Oct 7, 2026
1 check passed
@BretFisher
BretFisher deleted the feat/disable-service-links branch October 7, 2026 15:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread README.md
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants