Skip to content

Support K0S_JOIN_TOKEN and deprecate CLI token args#7929

Open
didiberman wants to merge 1 commit into
k0sproject:mainfrom
didiberman:support-join-token-env-var
Open

Support K0S_JOIN_TOKEN and deprecate CLI token args#7929
didiberman wants to merge 1 commit into
k0sproject:mainfrom
didiberman:support-join-token-env-var

Conversation

@didiberman

@didiberman didiberman commented Jul 3, 2026

Copy link
Copy Markdown

Description

This PR resolves #5253 by:

  1. Adding support for the K0S_JOIN_TOKEN environment variable as the preferred source for join tokens.
  2. Falling back to the legacy K0S_TOKEN environment variable for backwards compatibility.
  3. Adding deprecation warnings to both k0s controller and k0s worker subcommands when a join token is passed as a positional command-line argument.

This ensures credentials are passed securely and gives users a clear deprecation warning timeline to transition off positional arguments.

Testing

Ran unit tests for validation and retrieval:

  • go test -v ./cmd/internal/...
  • go test -v ./cmd/worker/...
    All tests passed successfully.

AI Assistance Note

This PR was written with AI assistance.

@didiberman
didiberman requested review from a team as code owners July 3, 2026 11:58
@didiberman
didiberman requested review from kke and makhov July 3, 2026 11:58
This commit adds the K0S_JOIN_TOKEN environment variable as the
preferred env source for join tokens, falling back to K0S_TOKEN
for backwards compatibility.

It also logs a deprecation warning if the join token is passed as
a positional CLI argument to k0s controller or k0s worker, to
give users time to transition to safer alternatives.

Fixes: k0sproject#5253
Signed-off-by: Didi Berman <didi@didibe.dev>
@didiberman
didiberman force-pushed the support-join-token-env-var branch from d3ebe06 to 36a2085 Compare July 5, 2026 07:54
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.

Support getting join token from environment variable

1 participant