Closed nathanmcgarvey-modopayments closed 1 year ago
Now that I'm looking at it, why are these variables being set in the helm chart?
- KUBERNETES_API_URL: https://172.20.0.1:443
- CA_FILE: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
Those should get picked up by default (I haven't tested, but it should)
Edit: at least in my local cluster, those variables are not necessary at all. Removed in the next commit.
Those should get picked up by default (I haven't tested, but it should)
When that code was written about 4 years ago this was not the case but a lot has changed since 😅
Edit: at least in my local cluster, those variables are not necessary at all. Removed in the next commit.
Give me a couple days and I'll test it.
Please test this locally (go run ./main.go) and in a k8s cluster both with a .kube/config with no KUBECONFIG env variable set and one with a KUBECONFIG env variable set before merging. It works for me, but I want to ensure it doesn't break anyone.
Instead of doing our own user home directory detection for .kube/config, use the k8s.io/cmdclient built-in methods which support KUBECONFIG env variable, $HOME/.kube/config, and KUBERNETES_SERVICE env variables automatically.
Also print out a sanitized representation of the config at startup in case of misconfiguration.