I am trying to connect to the Kubernetes Cluster, which is in a private network. I have HTTPS proxy, using which I can get Kubernetes api, using curl or web browser:
{
"kind": "Status",
"apiVersion": "v1",
"metadata": {
},
"status": "Failure",
"message": "Unauthorized",
"reason": "Unauthorized",
"code": 401
}
I have no luck connecting to cluster using kubectl.
If I set certificate-authority-data and proxy-url in kubeconfig - I get error:
Unable to connect to the server: proxyconnect tcp: x509: certificate signed by unknown authority
That's I believe because I have two self-signed certificates:one on proxy another on Kubernetes. (Btw I've added proxy certificate to my OS and have no errors on browser. But looks like kubectl don't care.)
If I set --insecure-skip-tls-verify=true in cli after kubectl ? I get an error in hexadecimal, which I don't know how to convert:
Unable to connect to the server: malformed HTTP response "\x00\x00\x12\x04\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x80\x00\x04\x00\x01\x00\x00\x00\x05\x00\xff\xff\xff\x00\x00\x04\b\x00\x00\x00\x00\x00\u007f\xff\x00\x00\x00\x00\b\a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01"
Any ideas how to connect to Kubernetes cluster behind https proxy?