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

[Chectl] support exported kubeconfigs when installing #15741

Closed
johnmcollier opened this issue Jan 17, 2020 · 2 comments
Closed

[Chectl] support exported kubeconfigs when installing #15741

johnmcollier opened this issue Jan 17, 2020 · 2 comments
Labels
area/chectl Issues related to chectl, the CLI of Che kind/enhancement A feature request - must adhere to the feature request template. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. severity/P1 Has a major impact to usage or development of the system. status/info-needed More information is needed before the issue can move into the “analyzing” state for engineering.

Comments

@johnmcollier
Copy link
Contributor

johnmcollier commented Jan 17, 2020

Is your enhancement related to a problem? Please describe.

I'm currently trying to run Che on IBM Kubernetes Service (IKS). When you authenticate against the cluster, IKS gives you the following command to run:

export KUBECONFIG=/Users/johncollier/.bluemix/plugins/container-service/clusters/<some-cluster>/kube-config.yml

When that command is run, your current terminal session will then be configured against that cluster.

An entry under ~/.kube/config is not created however when you configure the cluster.

When I go to run chectl server:start --platform=k8s --installer=operator --domain=<domain>, the command fails with the following error:

johns-mbp-3:~ johncollier$ chectl server:start --platform=k8s --installer=operator --domain=<domain>
  ✖ Verify Kubernetes API
    → Failed to connect to Kubernetes API. serviceaccounts is forbidden: User "s
…
    👀  Looking for an already existing Che instance
Eclipse Che logs will be available in '/var/folders/68/4ts5xvrx067bb614t74jpb9c0000gn/T/chectl-logs/1579277503234'
 ›   Error: Failed to connect to Kubernetes API. serviceaccounts is forbidden: 
 ›   User "system:anonymous" cannot list resource "serviceaccounts" in API 
 ›   group "" in the namespace "default"

This is because Che doesn't see the exported Kube config in $KUBECONFIG and is trying to install into a different cluster (whose context has long since expired).

Describe the solution you'd like

It would be nice if Chectl supported scenarios where the kube config was exported under the KUBECONFIG environment variable. This would allow Chectl to work against Kubernetes platforms like IKS that only provide the user with a Kube config file to export in their terminal. It would also be nice, as it could also mean users wouldn't have to reconfigure their default Kubernetes context if they wanted to quickly install Che on another cluster.

Describe alternatives you've considered

Manually creating the kube config entry in ~/.kube/config works, but it's a hassle and the certificates for the config expire every 12 or so hours, so I have re-do that step whenever I reconfigure against the cluster.

Manually installing the Che operator from operatorhub works fine too.

@johnmcollier johnmcollier added the kind/enhancement A feature request - must adhere to the feature request template. label Jan 17, 2020
@johnmcollier johnmcollier changed the title [Chectl] support exported kubeconfigs [Chectl] support exported kubeconfigs when installing Jan 17, 2020
@che-bot che-bot added the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label Jan 17, 2020
@tolusha tolusha added severity/P1 Has a major impact to usage or development of the system. area/chectl Issues related to chectl, the CLI of Che team/deploy and removed status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. labels Jan 17, 2020
@tolusha tolusha added this to the Backlog - Deploy milestone Jan 17, 2020
@tolusha tolusha mentioned this issue Mar 26, 2020
43 tasks
@tolusha tolusha added status/info-needed More information is needed before the issue can move into the “analyzing” state for engineering. and removed team/deploy labels Apr 17, 2020
@tolusha tolusha removed this from the Backlog - Deploy milestone Apr 17, 2020
@tolusha
Copy link
Contributor

tolusha commented Apr 17, 2020

@johnmcollier
While working on the issue I realized that underlying library takes into account KUBECONFIG environment variable. In the latest version of chectl I've just added logging the current context on chectl start.
I would be nice if you check if it works on your side now.

@che-bot
Copy link
Contributor

che-bot commented Oct 28, 2020

Issues go stale after 180 days of inactivity. lifecycle/stale issues rot after an additional 7 days of inactivity and eventually close.

Mark the issue as fresh with /remove-lifecycle stale in a new comment.

If this issue is safe to close now please do so.

Moderators: Add lifecycle/frozen label to avoid stale mode.

@che-bot che-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 28, 2020
@che-bot che-bot closed this as completed Jan 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/chectl Issues related to chectl, the CLI of Che kind/enhancement A feature request - must adhere to the feature request template. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. severity/P1 Has a major impact to usage or development of the system. status/info-needed More information is needed before the issue can move into the “analyzing” state for engineering.
Projects
None yet
Development

No branches or pull requests

3 participants