Based on the KubeView README, I tried to run KubeView using the container provided here.
I run:
$ docker run --publish-all --name kubeview ghcr.io/benc-uk/kubeview:0.1.31
I get the following output:
2023/03/12 18:06:45 ### Kubeview v0.1.31 starting...
2023/03/12 18:06:45 ### Connecting to Kubernetes...
2023/03/12 18:06:45 ### Creating client with config file: /.kube/config
panic: stat /.kube/config: no such file or directory
goroutine 1 [running]:
main.main()
/build/cmd/server/main.go:60 +0x6a5
I can see that the problem is that the tool is looking for the kubeconfig file in /.kube/config. It can't find it because mine is in my home directory, ~/.kube/config/
I tried to pass an environment variable like this:
$ docker run --publish-all --name kubeview -e KUBECONFIG=/Users/<MY_USERNAME>/.kube/config ghcr.io/benc-uk/kubeview:latest
It didn't work. Has anyone been able to run KubeView as a container? I'm on a Mac.
You can mount your local kubeconfig file to the Docker image that you are trying, not sure if the way you follow Env variable option is suggested anywhere or not
Try something like :
./config - will the path of your
~/.kube/config/local system/.kube/config - path where your local file will get set in the container, so when container will run your local file will be available at that path
Tried with fake values, which not able to parse but it got the file