Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

cli: add support for --kubeconfig flag

Open
#386 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
go
Domain
cli

Research direction

Start by locating the CLI command setup and the existing Kubernetes client configuration, then trace how the KUBECONFIG environment variable is read. Verify the relevant command help and tests before implementing the flag; done means CLI requests can use an explicitly supplied kubeconfig path without relying on KUBECONFIG.

Written by the indexing model from the issue text.

Description

enhancement
What problem are you facing?

Switching around kubeconfig files using the KUBECONFIG environment variable might be error prone (e.g. when running commands from history in distinct terminals).

How could Crossplane help solve your problem?

Kubectl and most k8s related clis support the --kubeconfig command line argument in order to support "stateless commands" that don't rely on KUBECONFIG environment variable being set

flux --help | grep '\--kubeconfig'
#>      --kubeconfig string              Path to the kubeconfig file to use for CLI requests.

kubectl cnpg --help | grep '\--kubeconfig'
#>      --kubeconfig string                 Path to the kubeconfig file to use for CLI requests.

kyverno --help | grep 'kubeconfig'
#      --kubeconfig string                   Paths to a kubeconfig. Only required if out-of-cluster.

velero --help | grep 'kubeconfig'
#>      --kubeconfig string                   Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration

k9s --help | grep '\--kubeconfig'
#>      --kubeconfig string              Path to the kubeconfig file to use for CLI requests
Dominant language
Go
Stars
19
Forks
31
Avg merge
2d 12h
Merged PRs (30d)
52

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from crossplane/cli

All issues in crossplane/cli

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.