My local system's kubectl is currently pointing to my digitalocean kubernetes cluster. I wrote an app in Rust that can list the pods on my cluster and their CPU usage, which is working fine on local system.
Now, I dockerized this application, so now it is running as a container.
How can I configure my docker-compose in such a way, so that it can access local system's kubectl ?
I tried this on the basis of suggested solutions:
version: "3.3"
services:
custom-tool:
container_name: custom-tool
image: myimage:v16
restart: always
command: ./main-thread
environment:
- KUBECONFIG=/root/config
volumes:
- /home/keval/.kube/config:/root/config
But, no luck yet !