I wanted to run kube-dump directly inside a container in a k8s cluster, but I always get an authorization error on k8s API (HTTP 401)
Therefore, I created the service account and also the role binding to cluster-admin role. Executing any kubectl command inside the container works without any problems.
What I don't understand is, why are you getting the key when you are not using it in the curl command? Only using the cert is not enough for authorization.
I wanted to run kube-dump directly inside a container in a k8s cluster, but I always get an authorization error on k8s API (HTTP 401)
Therefore, I created the service account and also the role binding to cluster-admin role. Executing any kubectl command inside the container works without any problems.
What I don't understand is, why are you getting the key when you are not using it in the curl command? Only using the cert is not enough for authorization.
A Better way to solve that check would be: (https://github.com/WoozyMasta/kube-dump/blob/master/kube-dump#L242)
With these changes it finally works