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
If I use kubectl inside a Pod without providing a service account or any configuration it defaults to using the same namespace the Pod is running in. But kr8s just uses default.
To reproduce create a new namespace and start an interactive Pod inside it.
Create a new namespace
$ kubectl create namespace foonamespace "foo" createdRun an interactive Pod in that namespace
$ kubectl run python --image python --namespace foo --rm -it -- bash
Install kubectl and try to list Pods.
Install kubectl
# apt update && apt install curl -y && curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"&& chmod +x kubectl && mv kubectl /usr/local/bin/...Try to list Pods
# kubectl get podsError from server (Forbidden): pods is forbidden: User "system:serviceaccount:foo:default" cannot list resource "pods" in API group "" in the namespace "foo"
Note the error says cannot list resource "pods" in API group "" in the namespace "foo".
However if I do the same thing with kr8s it uses the default namespace.
Install kr8s
# pip install kr8s...Try to list Pods
# python -c 'import kr8s; kr8s.get("pods")'...kr8s._exceptions.ServerError: pods is forbidden: User "system:serviceaccount:foo:default" cannot list resource "pods" in API group "" in the namespace "default"
Note the error says cannot list resource "pods" in API group "" in the namespace "default".
Anything else?
No response
The text was updated successfully, but these errors were encountered:
Which project are you reporting a bug for?
kr8s
What happened?
If I use
kubectl
inside a Pod without providing a service account or any configuration it defaults to using the same namespace the Pod is running in. Butkr8s
just usesdefault
.To reproduce create a new namespace and start an interactive Pod inside it.
Install
kubectl
and try to list Pods.Note the error says
cannot list resource "pods" in API group "" in the namespace "foo"
.However if I do the same thing with
kr8s
it uses thedefault
namespace.Note the error says
cannot list resource "pods" in API group "" in the namespace "default"
.Anything else?
No response
The text was updated successfully, but these errors were encountered: