Live data from Hacker News

Cyphernetes: A Query Language for Kubernetes

cyphernet.es

1–10 of 69 posts

Re: Cyphernetes: A Query Language for Kubernetes

#4
post #2

I dunno, Kubernetes has a query language, it's called jq. As in, kubectl get pods -A -ojson | jq -r '.items[] | ...'. Cyphernetes seems simpler perhaps but it's not the 10x improvement I need to switch and introduce a new dependency.

You usually don't need that, since kubectl supports jsonpath.

Re: Cyphernetes: A Query Language for Kubernetes

#6
I'm not against replacing jq/jsonpath for the right tool, they're not the most ergonomic. What isn't clear to me though is why this isn't SQL? It's so nearly SQL, and seems to support almost identical semantics. I realise SQL isn't perfect, but the goal of this project isn't (I assume) to invent a new query language, but to make Kubernetes more easily queryable.

Re: Cyphernetes: A Query Language for Kubernetes

#7
post #3

What does this offer over jq which I can also afford?

Cyphernetes seems capable of graph/relational logic.

The example on the homepage is literally "give me deployments with more than 2 replicas with pods that are not Running, and give me the IP address of the service they're serving"...

Any idea how to do that with kubectl | jq? Their solution seems elegant to me.

Re: Cyphernetes: A Query Language for Kubernetes

#8
post #2

I dunno, Kubernetes has a query language, it's called jq. As in, kubectl get pods -A -ojson | jq -r '.items[] | ...'. Cyphernetes seems simpler perhaps but it's not the 10x improvement I need to switch and introduce a new dependency.

I guess they would say that you have to send the output of that to be inputs of another kubectl command like

  $ kubectl logs -n foo $(kubectl get pod -n foo | awk '/Running/{print $1}')
because one of their selling points is "no nested kubectl queries".

I don't see how their queries can be more efficient than hitting the kube-apiserver multiple times, unless they have something that lives clusterside observing lifecycle events for all CRDs and answering queries with only one round-trip instead of multiple.

Or maybe they're selling "no nested kubectl queries" as an experience feature, saying that a query language is more ergonomic than bash command redirection. My brain has been warped into the shape of the shell, for better or for worse, so it's not a selling point for me.

Re: Cyphernetes: A Query Language for Kubernetes

#9

I'm not against replacing jq/jsonpath for the right tool, they're not the most ergonomic. What isn't clear to me though is why this isn't SQL? It's so nearly SQL, and seems to support almost identical semantics. I realise SQL isn't perfect, but the goal of this project isn't (I assume) to invent a new query language, but to make Kubernetes more easily queryable.

Reading your comment made me think that they're so close to "OSQuery for k8s", but that already seems to exist: https://www.uptycs.com/blog/kubequery-brings-the-power-of-os...
Post reply on HN