使用纯 SQL 查询 K8s API 的实验工具
kubesql
kubesql, an experimental tool for querying your Kubernetes API Server using simple and smallest SQL syntax.
$ kubesql -q "SELECT namespace FROM context WHERE pod.status.phase = 'Running'"$ docker pull furkanturkal/kubesql:0.1.0$ cargo install --path . # local
# - or -
$ cargo install --git https://github.com/Dentrax/kubesql # remoteUSAGE:
kubesql [OPTIONS]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-f, --file
-q, --query $ kubesql --file ./kube.sql
$ kubesql --query "SELECT namespace FROM context WHERE pod.status.phase = 'Running'"$ docker container run -v ~/.kube/config/:/home/nonroot/.kube/config kubesql:0.1.0 --query "SELECT namespace FROM context WHERE pod.status.phase = 'Running'"SELECT namespace
FROM context
WHERE pod.status.phase = 'Running'SELECT namespace1, namespace2
FROM context1, context2
WHERE pod.status.phase = 'Running' AND deployment.metadata.name = 'my-awesome-deployment'| STATEMENT | REQUIRED |
|---|---|
| SELECT | ✓ |
| FROM | ✓ |
| WHERE | ✓ |
| OPERATOR | WHERE | ACTION |
|---|---|---|
| AND | ✓ | Panic if no result found |
| OR | ✓ | Continue |
| Package | Author | License |
|---|---|---|
| sqlparser | ballista-compute | Apache License 2.0 |
| kube | clux | Apache License 2.0 |
| prettytable | phsym | MIT |
kubesql was created by Furkan 'Dentrax' Türkal
The base project code is licensed under MIT unless otherwise specified. Please see the LICENSE file for more information. Best Regards
暂无开放 Issues,或尚未同步最近议题。