GithubHelp home page GithubHelp logo

kubesql's Introduction

kubesql

An experimental tool for querying your Kubernetes API Server using SQL

MIT GitHub release


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'"

Screenshot

Installation

Docker

$ docker pull furkanturkal/kubesql:0.1.0

From Source

$ cargo install --path . # local
# - or -
$ cargo install --git https://github.com/Dentrax/kubesql # remote

Usage

asciicast

USAGE:
    kubesql [OPTIONS]

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -f, --file <FILE>      
    -q, --query <query>

Evaluate

$ kubesql --file ./kube.sql
$ kubesql --query "SELECT namespace FROM context WHERE pod.status.phase = 'Running'"

With Docker

$ docker container run -v ~/.kube/config/:/home/nonroot/.kube/config kubesql:0.1.0 --query "SELECT namespace FROM context WHERE pod.status.phase = 'Running'"

Quick Start

SQL Syntax

Single Context

SELECT namespace
FROM context
WHERE pod.status.phase = 'Running'

Multiple Context-Namespace

SELECT namespace1, namespace2
FROM context1, context2
WHERE pod.status.phase = 'Running' AND deployment.metadata.name = 'my-awesome-deployment'

Supported Statements

STATEMENT REQUIRED
SELECT
FROM
WHERE

Supported Operators

OPERATOR WHERE ACTION
AND Panic if no result found
OR Continue

Special Thanks

Package Author License
sqlparser ballista-compute Apache License 2.0
kube clux Apache License 2.0
prettytable phsym MIT
  • Thanks to everyone who contributed these libraries and others that made this project possible.

License

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.

FOSSA Status

Best Regards

kubesql's People

Contributors

dentrax avatar

Watchers

 avatar

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.