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

Add support for KUBECONFIG with multiple files #5105

Closed

Conversation

rodcloutier
Copy link
Contributor

@rodcloutier rodcloutier commented Jan 25, 2024

This PR intends to solve the issue where a kubeconfig containing multiple files could not be used with Kamel.

As defined in https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/#linux-1

Release Note

Add support to allow Kubeconfig to contain multiple file when using Kamel

Fixes #5107

Copy link
Contributor

@squakez squakez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't looked deeply at this, but it seems to me that we're completely ignoring the kubeconfig parameter. And it's used in the CLI for the

      --kube-config string   Path to the kube config file to use for CLI requests

feature.

Copy link
Contributor

@squakez squakez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this, we'd move from a file based approach to the env var based approach expected by Kubernetes. I don't have any objection, however, if we want to do this we cannot remove the file based approach directly. We need to keep supporting it, adding this new approach beside the old one and also adding some documentation to [1].

Mind that we're planning to move the entire CLI to Camel Jbang [2], so, any work done in the CLI, may be disappearing during 2024.

[1] https://camel.apache.org/camel-k/2.2.x/cli/cli.html#_global_flags
[2] apache/camel#12474

@rodcloutier rodcloutier force-pushed the Fix-proper-kubeconfig-parsing branch from d93fa7a to 78d442c Compare January 26, 2024 13:31
@rodcloutier
Copy link
Contributor Author

I haven't looked deeply at this, but it seems to me that we're completely ignoring the kubeconfig parameter. And it's used in the CLI for the

      --kube-config string   Path to the kube config file to use for CLI requests

feature.

You are right. I forgot to keep the current functionality. I have updated the commit to add support for the argument as well and keep the current functionality.

@rodcloutier
Copy link
Contributor Author

rodcloutier commented Jan 26, 2024

Mind that we're planning to move the entire CLI to Camel Jbang [2], so, any work done in the CLI, may be disappearing during 2024.

The plan is to move the CLI portion but not the operator if I understand correctly?

@rodcloutier
Copy link
Contributor Author

rodcloutier commented Jan 26, 2024

I went a little deeper in the whole usage of the kubeconfig file and we would need to revise the way it is handled. Some shortcuts were taken and do not exactly follow the kubernetes way to implement a client.

Given that there is a migration planned, we can drop this PR as the workaround is not that difficult (was more a quality of life issue).

@squakez
Copy link
Contributor

squakez commented Jan 26, 2024

No problem. Thanks for taking the time to make the development though.

@squakez
Copy link
Contributor

squakez commented Jan 26, 2024

Mind that we're planning to move the entire CLI to Camel Jbang [2], so, any work done in the CLI, may be disappearing during 2024.

The plan is to move the CLI portion but not the operator if I understand correctly?

Yes, just the CLI.

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.

Kamel executable does not support Kubeconfig with multiple files
2 participants