You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 1, 2018. It is now read-only.
We have setup Kubernetes OIDC authentication against our Google domain. Note, this is not a GKE cluster like in #65; we're hosted in AWS. Our OIDC setup uses k8s-oidc-helper.
I don't understand the auth bits sufficiently to debug this. For now I can work around it by retaining a non-OIDC context in my $HOME.kube/config and using that for out-of-cluster development with pykube, then deploying my apps in the cluster with a serviceaccount.
OIDC user in kubeconfig:
(sorry about all the redacting... I can only assure you that the setup works with kubectl!)
$ kubectl config use-context oidc.context
Switched to context "oidc.context".
$ ./kubetest.py
Traceback (most recent call last):
File "./kubetest.py", line 16, in <module>
for watch_event in watch.watch():
File "/usr/local/lib/python3.6/site-packages/pykube/query.py", line 158, in object_stream
r = self.api.get(**kwargs)
File "/usr/local/lib/python3.6/site-packages/pykube/http.py", line 127, in get
return self.session.get(*args, **self.get_kwargs(**kwargs))
File "/usr/local/lib/python3.6/site-packages/pykube/http.py", line 39, in session
self._session = build_session(self.config, self.gcloud_file)
File "/usr/local/lib/python3.6/site-packages/pykube/session.py", line 23, in build_session
s = _session_object("gcp", config, gcloud_file)
File "/usr/local/lib/python3.6/site-packages/pykube/session.py", line 47, in _session_object
return GCPSession(config, gcloud_file).create()
File "/usr/local/lib/python3.6/site-packages/pykube/session.py", line 85, in __init__
self.credentials = self._load_default_gcloud_credentials()
File "/usr/local/lib/python3.6/site-packages/pykube/session.py", line 166, in _load_default_gcloud_credentials
raise PyKubeError('Google cloud well known file missing, configure your gcloud session')
pykube.exceptions.PyKubeError: Google cloud well known file missing, configure your gcloud session
installed pykube from latest master commit in a virtualenv and retested with OIDC:
$ ./kubetest.py
Traceback (most recent call last):
File "./kubetest.py", line 11, in <module>
for watch_event in watch.watch():
File "/Users/johnslee/vc/sm/kube2pingdom/venv/src/pykube/pykube/query.py", line 160, in object_stream
self.api.raise_for_status(r)
File "/Users/johnslee/vc/sm/kube2pingdom/venv/src/pykube/pykube/http.py", line 234, in raise_for_status
resp.raise_for_status()
File "/Users/johnslee/vc/sm/kube2pingdom/venv/lib/python3.6/site-packages/requests/models.py", line 935, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://oidc.context.api.endpoint/apis/extensions/v1beta1/namespaces/core/ingresses?watch=true
The text was updated successfully, but these errors were encountered:
We have setup Kubernetes OIDC authentication against our Google domain. Note, this is not a GKE cluster like in #65; we're hosted in AWS. Our OIDC setup uses k8s-oidc-helper.
I don't understand the auth bits sufficiently to debug this. For now I can work around it by retaining a non-OIDC context in my
$HOME.kube/config
and using that for out-of-cluster development withpykube
, then deploying my apps in the cluster with a serviceaccount.OIDC user in kubeconfig:
(sorry about all the redacting... I can only assure you that the setup works with
kubectl
!)kubectl
"just works" in all of our contexts:test code
works OK with a context that is not using OIDC:
but with OIDC, fails:
installed
pykube
from latestmaster
commit in a virtualenv and retested with OIDC:The text was updated successfully, but these errors were encountered: