Kubernetes + Steampipe
Steampipe is an open source CLI to instantly query cloud APIs using SQL.
Kubernetes is an open-source system for automating deployment, scaling, and management of containerized applications.
For example:
select name, namespace, phase, creation_timestamp, pod_ipfrom kubernetes_pod;
+-----------------------------------------+-------------+-----------+---------------------+-----------+| name | namespace | phase | creation_timestamp | pod_ip |+-----------------------------------------+-------------+-----------+---------------------+-----------+| metrics-server-86cbb8457f-bf8dm | kube-system | Running | 2021-06-11 14:21:48 | 10.42.0.5 || coredns-7448499f4d-klb8l | kube-system | Running | 2021-06-11 14:21:48 | 10.42.0.6 || helm-install-traefik-crd-hb87d | kube-system | Succeeded | 2021-06-11 14:21:48 | 10.42.0.3 || local-path-provisioner-5ff76fc89d-c9hnm | kube-system | Running | 2021-06-11 14:21:48 | 10.42.0.2 |+-----------------------------------------+-------------+-----------+---------------------+-----------+
Documentation
Get started
Install
Download and install the latest Kubernetes plugin:
steampipe plugin install kubernetes
Configuration
Installing the latest kubernetes plugin will create a config file (~/.steampipe/config/kubernetes.spc
) with a single connection named kubernetes
:
connection "kubernetes" { plugin = "kubernetes"}
This will create a kubernetes
connection that uses the default kubeconfig context.
Get involved
- Open source: https://github.com/turbot/steampipe-plugin-kubernetes
- Community: Slack Channel
Advanced configuration options
If you have a kube config setup using the kubectl CLI Steampipe just works with that connection.
The Kubernetes plugin allows you set the name of kube kubectl context with the config_context
argument in any connection profile. You may also specify the path to kube config file with config_path
argument.
This plugin also supports querying Kubernetes clusters using OpenID Connect (OIDC) authentication. No extra configuration is required in a connection profile to query clusters using OIDC.
Credentials via kube config
connection "k8s_minikube" { plugin = "kubernetes" config_context = "minikube" # config_path = "~/.kube/config"}