Hacker News new | past | comments | ask | show | jobs | submit login

This looks great for scripting. I will say that the query language looks a bit too verbose for daily use — meaning when you're interacting with a cluster to diagnose a problem, follow a job, testing the rollout of something experimental, or similar.

For example, I'd love to be able to just do this as the whole query:

    metadata.name =~ "foo%"
or maybe:

    .. =~ "foo%"  // Any field matches
or maybe:

    $pod and metadata.name =~ "foo%"  // Shorthand to filter by type
I think a query language for querying Kubernetes ought to start with predicate-based filtering as the foundation. Having graph operators seems like a nice addition, but maybe not the first thing people generally need?

It's not quite clear who this tool is for, so maybe this is not the intended purpose?




Hey, thanks for the feedback!

re. intended purpose: Initially I started writing this to help tackle bigger problems - stuff you'd normally use multiple nested kubectl commands or write a lot of code for interacting with api-server.

Over time, I developed the shell environment around it and it became a daily driver for me as well. Indeed, there's a threshold where writing Cyphernetes becomes more economical than using kubectl but for doing most of the simple day to day stuff writing Cypher is too verbose.

The Cyphernetes shell has an early-stage feature that allows a syntax like you suggested - there's a tiny "macros" feature that lets you define custom procedures of one or more queries (currently shell only, not supported in the web client yet).

Macros are prefixed by ":" and you could define something like:

:pod condition

MATCH (pods:Pod) WHERE $condition

RETURN p.metadata.name, p.status.phase; // and whatever other fields you'd like

Then use it like this: > :pod .metadata.name=~"foo%"

So it gives you a tiny way to customize how you do this day-to-day stuff. Ships out-of-the-box with common stuff you do with kubectl like :getpo, :getdeploy, :createdeploy, :expose and so on - definitely a feature that could be developed further to make this more of a daily driver.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: