Skip to content

Request: Support multiple documents in KUBECONFIG #1123

@robotrapta

Description

@robotrapta

What would you like to be added:

It sure would be handy if I could put multiple YAML documents into my KUBECONFIG file, separated by ---. Each one should be able to create its own contexts, and the cluster and user references should be scoped to within that document. The context names themselves would have to share a global namespace. If there were name collisions on the context names I think it would just have to throw an error.

Why is this needed:

We work with lots of different clusters, dynamically building them for various tasks. Various tools like microk8s and eksctl are happy to generate a complete kubeconfig needed to access the cluster. But merging the kubeconfigs together is error-prone. I've seen many a smart engineer flustered for quite a while because there's a mistake in there caused by not merging them properly.

With this change it would be much easier to merge them because in almost every case you could just append --- and the generated full kubeconfig from whatever source you got it from, and the only change you'd need to make would be to the name of the context.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions