Skip to content

Use --kubeconfig=/tmp/kubeconfig to avoid modifying /opt/kubeconfig with kubeadmin token #1191

Description

@praveenkumar

Currently, the crc-cluster-status.sh script logs into OpenShift using the kubeadmin account, which writes authentication tokens to the default kubeconfig file at /opt/kubeconfig. This results in kubeadmin token entries adding to the system:admin kubeconfig file, where the tokens eventually expire and may cause authentication or usability issues for system administrators.

Proposal:

  • Use --kubeconfig=/tmp/kubeconfig as a flag during oc login with the kubeadmin user.
  • This ensures the kubeadmin token is isolated in a temporary file, separate from the permanent system:admin kubeconfig in /opt/kubeconfig.
  • Prevents unnecessary token entries in the main kubeconfig and avoids future token expiration issues for system administrators who depend on /opt/kubeconfig as their main system:admin configuration.

This change improves token management and prevents accidental pollution or issues with privileged kubeconfig files.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

Status
No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions