I'm using the supported python Kubernetes library (pip install kubernetes
, v12.0.1). When I make a request to my cluster for any option (eg to create a Namespace
), it fails with the following error:
import kubernetes.client
def create_namespace(self, namespace_key):
with kubernetes.client.ApiClient(self.configuration) as client:
api = kubernetes.client.CoreV1Api(client)
api.create_namespace(
{
"apiVersion": "v1",
"kind": "Namespace",
"metadata": {
"name": namespace_key,
},
}
)
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='<url of my cluster>', port=443): Max retries exceeded with url: /api/v1/namespaces (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer
certificate (_ssl.c:1123)')))
If I turn off SSL configuration using self.configuration.verify_ssl = False
in the client, the request works, but it gives me a warning telling me that disabling SSL is strongly discouraged.
My setup:
- Ubuntu 20.04.1 LTS (running in a VM on mac OSX)
- Python 3.8.5 (virtual env, no pyenv or pipenv)
- The virtualenv has
certifiy==2020.11.8
installed (not sure if this impacts SSL interactions or not)
Is there anything system-wide that I need to do locally and/or to the docker container that will eventually be running these requests in production?
EDIT A bit more info:
>>> import ssl
>>> print(ssl.OPENSSL_VERSION)
OpenSSL 1.1.1f 31 Mar 2020