Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Handling multiple config files #19

Open
5nafu opened this issue Jun 3, 2022 · 0 comments
Open

Feature Request: Handling multiple config files #19

5nafu opened this issue Jun 3, 2022 · 0 comments

Comments

@5nafu
Copy link

5nafu commented Jun 3, 2022

Hi turkenh,

your tool looks quite cool, but unfortunately I do have multiple kubeconfig files that I would like to use.
Basically I split the config files by customer, and merging them together would make them quite messy.

On the commandline, I can use the KUBECONFIG environment variable to merge these files and they work fine with kubectl, kubectx, lens,...

my directory structure (~/.kube/config.d in my case) would look like:

$ ls -1
00_preferences
customer_1
customer_2
customer_3
private_cluster

The preferences file is basically being used to hold the current context and global preferences, the other files look like normal kubeconfig files:

apiVersion: v1
kind: Config
contexts:
- name: customer1-develop
  context:
    cluster: customer1-develop
    user: 5nafu@customer1
- name: customer1-production
  context:
    cluster: customer1-production
    user: 5nafu@customer1
- name: test@customer1-develop
  context:
    cluster: customer1-develop
    user: test@customer1

clusters:
- name: customer1-develop
  cluster:
    server: https://<URL redacted>
- name: customer_1-production
  cluster:
    server: https://<URL redacted>

users:
- name: 5nafu@customer1
  user:
    token: <TOKEN redacted>
- name: test@customer1
  user:
    token: <TOKEN redacted>

It would be great if KubeContext could support this kind of multiple files structure.

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

No branches or pull requests

1 participant