kubectl commands are failing due to proxy
Kubectl commands may fail with the following error:
E0403 14:04:05.944359 3116197 memcache.go:265] couldn't get current server API group list: Get "https://swimlane.dev.swimlane.example.com:6443/api?timeout=32s": Service Unavailable
- Check if there is a proxy enabled in the environment
env | grep -i proxy
The resulting output should be as below if there is a proxy enabled in place:
https_proxy=http://192.168.x.x:8080
http_proxy=http://192.168.x.x:8080
- Disable proxy from the node
export no_proxy=127.0.0.1,192.168.x.x,.default,kubernetes,.local,localhost,.svc,load balancer fqdn
The above should also be added to $HOME/.bashrc otherwise a node reboot will wipe it.
- Check to make sure the proxy is disabled.
env | grep -i proxy
The output from above should now be as below.
https_proxy=http://192.168.x.x:8080
http_proxy=http://192.168.x.x:8080
no_proxy=127.0.0.1,192.168.x.x,.default,kubernetes,.local,localhost,.svc,load balancer fqdn
- kubectl commands should work now.