Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

lokoctl fails to discover kubeconfig when cluster block is defined #105

Closed
surajssd opened this issue Mar 5, 2020 · 6 comments
Closed
Labels
bug Something isn't working

Comments

@surajssd
Copy link
Member

surajssd commented Mar 5, 2020

When I try to install the components defined in the .lokocfg file that also has cluster information (cluster "packet" {) then I get following error.

$ lokoctl component install prometheus-operator
Installing component 'prometheus-operator'...
FATA[0000] stat assets/cluster-assets/auth/kubeconfig: no such file or directory  args="[prometheus-operator]" command="lokoctl component install"
$ ls
lokocfg.vars  packet-cluster.lokocfg

I think it is trying to look for kubeconfig in the assets directory when there is none.

This error is encountered on:

$ lokoctl version
1c35d016

But this error is not seen if there is no cluster block defined in the directory.

@surajssd surajssd added the bug Something isn't working label Mar 5, 2020
@invidian
Copy link
Member

invidian commented Mar 5, 2020

@surajssd is your cluster installed? I think this is intended, if you have cluster block defined, then we take the kubeconfig file from the assets location. If there is no cluster block, then we fallback to KUBECONFIG environment variable.

@surajssd
Copy link
Member Author

surajssd commented Mar 6, 2020

The cluster is installed but I don't have it in this folder, in some other directory the asset exists.

@invidian
Copy link
Member

invidian commented Mar 6, 2020

I suggest running again lokoctl cluster install then, to ensure that all needed files are in place. Why would you not have this file in there?

@surajssd
Copy link
Member Author

Even if we fail we should fail with an error that tells user what they have done wrong then.

@invidian
Copy link
Member

I guess we could check if the cluster has been installed and if kubeconfig exists and give appropriate error message. And also suggest, that configuration files for cluster were found, so it will be installed on this cluster. We could also pull kubeconfig content from Terraform to not rely on reading the file from the disk. What do you think @surajssd ?

@invidian
Copy link
Member

I'll close this and let's track it in #608.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants