pykube
pykube copied to clipboard
help(SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)'),)
Traceback (most recent call last):
File "
Can you tell us a bit more about your setup? What is your configuration to connect to the cluster (KubeConfig I suppose)?
Running into the same problem when running in cluster using a service account: libssl rejects the API server's certificate for a reason I haven't figured out yet. On the other hand, in the same pod, kubectl
just works flawlessly with the given certificate chain / service account.
Maybe openssl s_client -showcerts -connect $KUBERNETES_SERVICE_HOST:$KUBERNETES_SERVICE_PORT -CAfile /run/secrets/kubernetes.io/serviceaccount/ca.crt
gives some insights.
@twz123 Recently have the same issue with service account
and self-signed certificates, but with older version of pykube==0.15.0
and requests==2.22.0
. The problem was with how the pykube
makes a request.Session
:
in requests==2.22.0
Session()
object, by default, have a parameter trust_env = True
, which force any request to use only environment certificates which break everything (even when you specify verify
parameter in Session()
).
Mb it will lead you to something useful.
I recently had a similar issue when trying out 'kube-web-view', and ended up editing session.verify
to be False all over the codebase, which got it working.
@korcky @zoidbergwill do you mind doing a PR with a proper fix?
I could try on this weekends, but I doesn't quite familiar with this version of pykube
(only worked with previous version that archived by now)