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

Use kubeconfig on desktop #25

Merged
merged 6 commits into from Feb 21, 2020
Merged

Conversation

ricoberger
Copy link
Member

@ricoberger ricoberger commented Feb 20, 2020

Instead of adding clusters manual to kubenav on desktop, the kubeconfig from ~/.kube/config is used now. Therefor the option to add clusters manual was removed.

With this approach all cloud providers like Google Cloud (GKE) and Amazon Web Services (EKS) should be supported on desktop for now.

Closes #13.

Clean up:

  • Remove the segment-wrapper CSS class, which was only used by the old screen for adding a cluster.
  • Fix the request method for alternative clusters, where the passed url was not used.
  • Fix the status check component, because the false URL was used.

For requests against an alternative cluster only the server url was
used, but not the passed in url.

Therefor the cluster status works, but the url must be changed to ''
after this bug fix.
Instead of manual adding clusters to kubenav on desktop, the kubeconfig
file of the user is used now.

At the start of the server component, the local kubeconfig file is
parsed. To use the clusters from the kubeconfig the server implements
two new endpoints cluster and clusters. These endpoints returning the
current context and all clusters from the kubeconfig file.

While the kubeconfig file is used now, it is not possible anymore to add
clusters manual to kubenav. But all cloud providers are supported on
desktop now.

When kubenav is started the current context and namespace is
automatically set as initial selected cluster.
@ricoberger ricoberger added the enhancement New feature or request label Feb 20, 2020
Since we are using the local kubeconfig file now, we had to adjust the
electron logic to show and switch clusters.

Now we are saving the selected cluster in localStorage and check if the
name form localStorage exists in the loaded clusters. When the name
exists this cluster will be used instead of the loaded active cluster
from the current context.
Instead of the last active cluster in kubenav, we use the cluster from
the current context as active cluster when kubenav is started.
Since wwe are using the local kubeconfig file, the edit and delete
options are not needed on desktop.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

Use host .kube/config file / kubectl command on Mac OS X
1 participant