deggja / netfetch

Kubernetes tool for scanning clusters for network policies and identifying unprotected workloads.
MIT License
406 stars 25 forks source link

In-Kubernetes cluster default netfetch installation throws `You're not connected to a Kubernetes cluster` #198

Open larssb opened 2 weeks ago

larssb commented 2 weeks ago

When installing netfetch-1.0.0 2.1.0 I get:

Using in-cluster Kubernetes configuration
You are not connected to a Kubernetes cluster. Please connect to a cluster and re-run the command: Get "https://10.241.8.1:443/api/v1/namespaces": dial tcp 10.241.8.1:443: i/o timeout

The IP 10.241.8.1 is correct. It is the ClusterIP of the kubernetes Service in the default namespace. I have other applications in the cluster that uses the kubernetes API address and works without issues.

Viewing GetClientset() in scanner.go this is where it seems to be determined that the in-cluster Kubeconfig should be used.

Looking at the netfetch Helm Chart values.yaml file I don't see any way to impact the kubeconfig configuration used.


What can I do to get to a place where this works? And what could be wrong.


Other info


Looking forward to knowing more and thank you very much.

deggja commented 1 week ago

Hello @larssb, First of all, thanks for using Netfetch! Are you able to exec into the container to ping the service to verify the connection issue - or is the pod stuck in crashing state? I'm not able to reproduce your error locally, not yet atleast. The helm chart has seen very little love since its creation, so I just updated it. Can you test and see if that helps?