• Stars
    star
    180
  • Rank 206,269 (Top 5 %)
  • Language
    Rust
  • Created about 3 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Experimental tool to query K8s API using plain SQL

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

More Repositories

1

GMDB

GMDB is the ultra-simple, cross-platform Movie Library with Features (Search, Take Note, Watch Later, Like, Import, Learn, Instantly Torrent Magnet Watch)
Go
234
star
2

cocert

Split and distribute your private keys securely amongst untrusted network
Go
202
star
3

Z00bfuscator

Z00bfuscator is the simple, open-source, cross-platform obfuscator for .NET Assemblies built on .NET Core
C#
177
star
4

Data-Structures-with-Go

Data Structures with Go Language
Go
139
star
5

falco-gpt

AI-generated remediations for Falco audit events
Go
67
star
6

Netlyser

Lightweight, a simple yet, Presence Detection Tool written in Rust, based on nmap, built for UNIX, made with <3
Rust
60
star
7

ArduRTOS

Real Time Operating System Lessons using Arduino and The FreeRTOS Kernel
C++
48
star
8

ProductManagementTool

Advanced Product tracking automation system using Qt 5 and C++
C++
47
star
9

xdsl-exporter

xDSL Prometheus Exporter
Go
45
star
10

Data-Mining-Algorithms

Data Mining Algorithms with C# using LINQ
C#
38
star
11

DentOS

Experimental Stand-alone 32-bit Kernel with Bootloader written in AT&T Assembly and Freestanding C
C
31
star
12

Monkey

Monkey Programming Language in Rust
Rust
30
star
13

TileMapGenerator

Create your own 2D Maps with layer-by-layer system using Noise-Sample and BufferedImage pattern
Java
26
star
14

Finite-State-Machine

Finite State Machine Library for .NET Core (with EASY and ADVANCED implementation)
C#
19
star
15

AsyncServerClient

AsyncServerClient is the simple, open-source, cross-platform Async TCP Server-Client project (with SQL and 3-Way Handshaking support) for .NET Assemblies built in .NET Core
C#
18
star
16

cosigneth

Container Image Signing & Verifying on Ethereum [Testnet]
TypeScript
17
star
17

go-tilde-operator

PoC: How to make ~ work on Go Compiler
16
star
18

MMM-ArduPort

This is a module for the MagicMirror² smart mirror project. This module provides Arduino serial communication support with Raspberry PI.
JavaScript
16
star
19

DLL-Injection-with-Assembly

DLL Injection to Exe with Assembly using OllyDbg
Assembly
16
star
20

obscure-go

In-memory security with secure data types
Go
15
star
21

remind-us

Schedule and generate custom reminders and send via custom alerters.
Go
12
star
22

EasySSA

An EASY and ADVANCED extention to handle TCP/IP Packets [SecurityApi]
C#
8
star
23

AVR-Programming-with-Assembly

AVR Microcontroller Programming with Assembly
Assembly
8
star
24

ArduExams

Improve your Arduino knowledge with high quality questions and exams
C++
6
star
25

EasyBlockChain

A cryptocurrency C++ implementation using a BlockChain technology made for educational purposes only
C++
2
star
26

Data-Mining-with-Python

Data Mining with Python
2
star
27

Dentrax

2
star
28

ArduRMMMQ

Ardu[R]eal-Time Operating System [MM] Magic Mirror [MQ] MQ Gas Sensor - RTOS Project
C++
2
star
29

AMX_Manager

[AMX]: [A]dministrative [M]anager Tools for [X] Server (Linux Environment Only)
Shell
2
star
30

Maxiploit

Exploit penetration tool for [Online Games]. [In Development]
C#
1
star
31

FollowUp-System-Automation

Simple Follow up Automation Example
Java
1
star
32

LedLooper-with-Assembly

Embedded Assembly LED project that uses AVR Microcontroller with Arduino
Assembly
1
star
33

EasySQLITE

An EASY and ADVANCED way to handle [SQLITE] Simple!, Lifesaver!, Friendly! ...
Java
1
star
34

EasyProviders

An EASY and ADVANCED way to handle providers/services/managers/singletons systems with [EasyProvides .NET CORE Library]
C#
1
star
35

k8s-response-engine-gke-functions

A simple demo about how to set up Kubernetes Respons Engine on GKE by using Google Cloud Functions, Falco and Falcosidekick
Go
1
star