-
Notifications
You must be signed in to change notification settings - Fork 48
lokoctl health
does not fallback for kubeconfig
#608
Comments
This is expected behavior. If you have the valid configuration in working directory, it should be used. This is duplicate of #105, right? |
Turns out we pass kubeconfig path a lot: $ git grep kubeconfig cli/ pkg/ | grep -v pkg/assets/generated_assets.go | grep kubeconfig | wc -l
55 The idea to solve this would to, to rather than passing kubeconfig path, we could pass the content of this file, which can be taken from anywhere. We could even validate it and pass it as some kind of generic client object, but this might be more difficult to use then. |
This commit adds NewClientset exported function, which allows creating Kubernetes Clientset from content of kubeconfig file, which allows to create it from sources differant than file on local file system. This is required for being able to execute 'lokoctl health' without having kubeconfig file present in local assets directory, as it can be pulled from other places, e.g. Terraform state. See #608 for more details. Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
This commit adds NewClientset exported function, which allows creating Kubernetes Clientset from content of kubeconfig file, which allows to create it from sources differant than file on local file system. This is required for being able to execute 'lokoctl health' without having kubeconfig file present in local assets directory, as it can be pulled from other places, e.g. Terraform state. See #608 for more details. Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
This commit adds NewClientset exported function, which allows creating Kubernetes Clientset from content of kubeconfig file, which allows to create it from sources differant than file on local file system. This is required for being able to execute 'lokoctl health' without having kubeconfig file present in local assets directory, as it can be pulled from other places, e.g. Terraform state. See #608 for more details. Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
This commit adds NewClientset exported function, which allows creating Kubernetes Clientset from content of kubeconfig file, which allows to create it from sources differant than file on local file system. This is required for being able to execute 'lokoctl health' without having kubeconfig file present in local assets directory, as it can be pulled from other places, e.g. Terraform state. See #608 for more details. Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
Getter struct and NewGetter function is a replacement for helm.sh/helm/v3/pkg/kube.GetConfig(), which allows to create Helm action config from the content of kubeconfig file, instead of from the path of the file, which is part of #608. Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
As part of #608, this commit changes the implementation of HelmActionConfig function to read the content of given kubeconfig file and then use the content to construct Helm's actionConfig. This will make easier changing the function signature to accept content of kubeconfig file in the future changes. Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
Instead of kubeconfig file path. This simplifies the tests and moves us closer towards resolving #608. Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
So we don't necesserily need a file on file system to perfrom this action, which is needed to resolve #608. Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
This commit changes InstallComponent and InstallAsRelease methods to accept kubeconfig content, rather than the file path, to allow loading it from places other than local filesystem. Part of #608. Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
The subcommand function will fail anyway while trying to read kubeconfig file, so there is no need to check it twice. Also part of #608. Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
Rather than kubeconfig file path. This will allow changing this function to pull kubeconfig content from Terraform output rather than from assets directory, which will resolve #608. Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
This commit adds NewClientset exported function, which allows creating Kubernetes Clientset from content of kubeconfig file, which allows to create it from sources differant than file on local file system. This is required for being able to execute 'lokoctl health' without having kubeconfig file present in local assets directory, as it can be pulled from other places, e.g. Terraform state. See #608 for more details. Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
Getter struct and NewGetter function is a replacement for helm.sh/helm/v3/pkg/kube.GetConfig(), which allows to create Helm action config from the content of kubeconfig file, instead of from the path of the file, which is part of #608. Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
As part of #608, this commit changes the implementation of HelmActionConfig function to read the content of given kubeconfig file and then use the content to construct Helm's actionConfig. This will make easier changing the function signature to accept content of kubeconfig file in the future changes. Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
Instead of kubeconfig file path. This simplifies the tests and moves us closer towards resolving #608. Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
So we don't necesserily need a file on file system to perfrom this action, which is needed to resolve #608. Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
This commit changes InstallComponent and InstallAsRelease methods to accept kubeconfig content, rather than the file path, to allow loading it from places other than local filesystem. Part of #608. Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
The subcommand function will fail anyway while trying to read kubeconfig file, so there is no need to check it twice. Also part of #608. Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
Rather than kubeconfig file path. This will allow changing this function to pull kubeconfig content from Terraform output rather than from assets directory, which will resolve #608. Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
This commit adds NewClientset exported function, which allows creating Kubernetes Clientset from content of kubeconfig file, which allows to create it from sources differant than file on local file system. This is required for being able to execute 'lokoctl health' without having kubeconfig file present in local assets directory, as it can be pulled from other places, e.g. Terraform state. See #608 for more details. Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
Getter struct and NewGetter function is a replacement for helm.sh/helm/v3/pkg/kube.GetConfig(), which allows to create Helm action config from the content of kubeconfig file, instead of from the path of the file, which is part of #608. Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
As part of #608, this commit changes the implementation of HelmActionConfig function to read the content of given kubeconfig file and then use the content to construct Helm's actionConfig. This will make easier changing the function signature to accept content of kubeconfig file in the future changes. Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
Instead of kubeconfig file path. This simplifies the tests and moves us closer towards resolving #608. Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
This commit changes InstallComponent and InstallAsRelease methods to accept kubeconfig content, rather than the file path, to allow loading it from places other than local filesystem. Part of #608. Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
The subcommand function will fail anyway while trying to read kubeconfig file, so there is no need to check it twice. Also part of #608. Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
Rather than kubeconfig file path. This will allow changing this function to pull kubeconfig content from Terraform output rather than from assets directory, which will resolve #608. Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
Oops, that shouldn't be closed. We are still missing #701. |
Closes #608 Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
Not just health but $ lokoctl component apply metrics-server
FATA[0000] Error in finding kubeconfig file: open assets/cluster-assets/auth/kubeconfig: no such file
or directory args="[metrics-server]" command="lokoctl component apply" Even though I have the $ kubectl get nodes
NAME STATUS ROLES AGE VERSION
foo-controller-0 Ready <none> 90m v1.18.6
foo-openebs-worker-0 Ready <none> 89m v1.18.6 |
@invidian should we at least get the fallback issues solved? Later we can look into extracting kubeconfig from the state? |
What do you mean by fallback? It shouldn't do any fallback if file is missing, as it may install things on a wrong cluster. |
Then we should fix the kubeconfig flag help. |
To mention if the cluster configuration is present in working directory? That make sense I guess 👍 |
It seems like too bit detail to put in the CLI flag description :| |
We should completely remove the fallback to the global kubeconfig automatically and update the flag description. |
If we remove that, we won't be able to install components on clusters managed with |
@surajssd BTW current help message looks following:
|
Actually, I created #820 to get rid of this flag completely, simplifying the whole thing. |
Closes #608 Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
Closes #608. Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
Closes #608. Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
#701 is now ready to review. |
Closes #608. Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
Closes #608. Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
I don't have assets dir locally but in S3 and when I run following:
It did not fallback to
~/.kube/config
as mentioned in the--kubeconfig
flag description.And same for
component apply
as well:The text was updated successfully, but these errors were encountered: