Code Monkey home page Code Monkey logo

Comments (5)

boz avatar boz commented on May 18, 2024 1

I think that's the logic I wrote down.

👍 pre-coffee parsing never works for me. Thanks for the input!

from kail.

boz avatar boz commented on May 18, 2024

Hi @rcoup, thanks for the input!

I agree that the kube-system ns is distracting. That being said, kail is meant to be a simple "just give me the damn logs" utility; kubectl's --all-namespaces is particularly annoying to me.

I think something like the following would be a reasonable approach:

  • Ignore system namespaces: Add an --ignore-ns=... flag that defaults to (kube-system). Similar to the current --ignore flag.
  • Use "current" namespace: Add --current-ns=true|false flag.
  • Collect --ignore-ns, --current-ns, --ns, etc... values from environment variables.

Let me know if you have any thoughts on this.

Currently, --ns matches all namespaces, and --ns= matches nothing.

Thanks for pointing that out, these should have the same behavior.

from kail.

rcoup avatar rcoup commented on May 18, 2024

We mostly use namespaces for logical app separation, so (virtually) everything relevant is in the same namespace. But I guess that can be different for everyone.

I'm not that keen on another flag for --current-ns. But everything is additive, I'd forgotten that, which would make a bare --ns trickier to implement. 👍

So:

  • kail -> {$all}-{$ignored}
  • kail --ns=foo -> {foo}
  • kail --ns=foo --ns=bar -> {foo} + {bar}
  • kail --current-ns -> {$current}
  • kail --current-ns --ns=foo -> {foo} + {$current}
  • --ignore-ns setting would only be used when --ns or --current-ns aren't specified (can't see it helps any other approach?)

from kail.

boz avatar boz commented on May 18, 2024

I'm not that keen on another flag for --current-ns.

Me neither, but if it's easy to use and not confusing, I'd go for it. At the end of the day, this can all be done with scripting, but it's nice to have some things baked in instead of this:

alias kailc='kail --ns $(kubectl config view -o jsonpath="{.contexts[?(.name==\"$(kubectl config current-context)\")].context.namespace}") '

I frankly don't even know if it's possible to get the current namespace from client-go

--ignore-ns setting would only be used when --ns or --current-ns aren't specified (can't see it helps any other approach?)

I was thinking it'd default to kube-system. It can be disabled by making it empty; --ns and --current-ns could have precedence over it too I guess. It helps because I don't think many people want to see the kube-system logs.

from kail.

rcoup avatar rcoup commented on May 18, 2024

It can be disabled by making it empty; --ns and --current-ns could have precedence over it too I guess.

I think that's the logic I wrote down? If you specify ns/current-ns then you don't get "all" anymore, and anything you do specify should override the ignore list anyway.

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.