Code Monkey home page Code Monkey logo

Comments (8)

b3zn0gim avatar b3zn0gim commented on May 17, 2024 1

Looks like in later versions situation become even worse. I want my teams to be able to read logs this way:

kail -n personal-namespace -l 'app=proxy'

I already gave cluster scope permission to read namespaces, but, I think, since last version of kail it also want to read pods at cluster scope and the command above doesn't work anymore. It produces error like:

$ kail -n personal-namespace -l 'app=proxy'
ERRO[0000] client list: pods is forbidden: User "system:serviceaccount:default:superhero" cannot list resource "pods" in API group "" at the cluster scope  cmp=lister

Even tho user have permissions to read namespaces and to read pods in specified namespace.

I was able to reproduce the same error using command

kubectl get pod --all-namespaces

I think in latest versions kail was switched to this behaviour and it broke our usual workflow. Now I have to give people clusterscope permission to read all pods in my cluster and that is not something what I to do by any chance.

from kail.

boz avatar boz commented on May 17, 2024

Yeah it does not push down all of the constraints (you might add another --ns flag, for instance). Also, you can select for things which haven't been created yet - it needs to be able to listen for new resources.

That said, namespace might be a special case - it probably isn't necessary to list/watch namespaces since the ns name is in all of the objects. If this ends up being a big problem I can address it.

Try using this to prevent the namespace list:

./kail --context=dev  --svc=ns1/projector

from kail.

boz avatar boz commented on May 17, 2024

@slawo let me know if the workaround solves the issue. Thanks for the report!

from kail.

wsargent avatar wsargent commented on May 17, 2024

This is an issue for me as well:

❱ kail --pod=mah-pod --ns=my-namespace
ERRO[0000] client list: pods is forbidden: User "..." cannot list pods at the cluster scope  cmp=lister
ERRO[0000] lister error: client list: pods is forbidden: User "..." cannot list pods at the cluster scope  cmp=controller
kail: error: Unable to initialize data source

from kail.

boz avatar boz commented on May 17, 2024

Hey @wsargent. Long time no see! Hope you're doing well.

Did you try the workaround I posted?

kail --pod=my-namespace/mah-pod

from kail.

wsargent avatar wsargent commented on May 17, 2024

Oh hi Adam!

Same deal with namespace/mah-pod -- "cannot list pods at the cluster scope cmp=lister" and the same error with "cmp=controller"

from kail.

boz avatar boz commented on May 17, 2024

Thanks @wsargent! I'll take a look at this when I can.

from kail.

ngauje avatar ngauje commented on May 17, 2024

Same problem here when using Kail on an Openshift cluster :
kail: error: Can't connnect to kubernetes: namespaces is forbidden: User "stduser" cannot list namespaces at the cluster scope: User "stduser" cannot list all namespaces in the cluster

from kail.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.