-
-
Notifications
You must be signed in to change notification settings - Fork 298
Description
The kubeconfig
flag on the app install
command does not affect the actual kubernetes command execution. The kubernetes command is executed against the default kubeconfig file, not the one passed in via flags.
Expected Behaviour
Passing the kubeconfig
flag on the app install
command should use that kubeconfig file when installing the app.
Current Behaviour
The kubeconfig
variable is only written out, but not utilized:
https://github.com/alexellis/k3sup/blob/master/pkg/cmd/openfaas_app.go#L42
Possible Solution
Since the kubernetes_exec.go
file is also in the cmd
package, it's possible for the kubectl
and kubectlTask
functions to look for changes on the flag to get that passed in value. Much the same as the above pasted code from one of the apps.
Steps to Reproduce (for bugs)
k3sup app install openfaas --kubeconfig any/path/to/file
- Output will say something like: "Using kubeconfig {the path from above}"
- Run
kubectl get pods --all-namespaces --kubeconfig /same/path/above
- Observe the app was not installed
- Run
kubectl get pods --all-namespaces
(without the kubeconfig) - See the application was installed on the incorrect cluster
Context
I have several k8s cluster set up in various environments for testing. Swapping the config files, or env var is annoying, and really time consuming if I forget before I run the install command.
Your Environment
- What OS or type or VM are you using? Where is it hosted?
Linux/ARM
Desktop (microk8s), GCP, DigitalOcean, Raspberry Pi 3+ - Operating System and version (e.g. Linux, Windows, MacOS):
Linux