3 ms·
A Kubernetes Query Language
- fatliverfreddy 2y agoLearn a new language to unlock the power of the Kubernetes graph. Query multiple resource kinds and compose custom JSON payloads Express complex CRUD operations in a compact, effective new way. Full-featured interactive shell includes completion, syntax highlighting, resource graph visualization in ASCII-art and more.
- zactato 2y agoI should know this, but does K8s actually store objects as a graph internally? Is this doing multiple api calls? How does it perform at scale?
- fatliverfreddy 2y agoK8s does not store any graph model internally. The relationship engine in Cyphernetes is comparing fields that should either match/contain all/etc. between two resources - for example a ResplicaSet's .metadata.ownerReferences[].name matches a Deployment's .metadata.name, or a Deployment's .metadata.labels contains all of a Service's spec.selector. These rules are used both to read the resources but also for creating them. Each rule may also contain a set of default properties which are used in create operations - for instance: `MATCH (d:Deployment {name: "nginx"}) CREATE (d)->(s:Service)` Will create a clusterIp Service (similar to what `kubectl expose` does). Doing this with kubectl or programmatically without tuning for rate limiting, implementing caching etc. of course fails even at a very small scale - Cyphernetes has its own request throttling and caching layer to make this possible.
- zaps 2y agoPhern is terrifying.
- fatliverfreddy 2y agoIt seems terrifying at first but once you get to know it you’ll get over it. It’s super cuddly and really into graphs.
- muixoozie 2y agoReminds me of fizzgig https://www.youtube.com/watch?v=lSnzoeZMljM https://www.youtube.com/watch?v=lSnzoeZMljM
- fatliverfreddy 2y agoOh I loved The Dark Crystal! Forgot about that little guy. Will use as inspiration for the next iteration :)
- zug_zug 2y agoIf you want to expose kubernetes by a query language, why not expose an SQL interface?
- fatliverfreddy 2y agoI personally am a fan of Cypher and a Cypher-inspired language to describe graph operations in Kubernetes had been a dream of mine for several years until I eventually mustered the courage to create it myself. I just think it’s a great fit, much more than SQL! I’m aware picking up a new language will be a barrier for most to pick it up, and that’s fine. In any case I think this is an interesting tool worth sharing and I hope to find a few more that will be into it, who knows! While doing the research for this tool I did however come across two projects that do exactly what you describe: kubeql: https://github.com/saracen/kubeql https://github.com/saracen/kubeql kubesql: https://github.com/xuxinkun/kubesql https://github.com/xuxinkun/kubesql I’m not sure if either graduated past doing read operations, and both aren’t maintained anymore.