Skip to main content

Background

The Run Kubernetes Cloud Query Action performs Steampipe queries on K8s resources with a powerful and simple PostgreSQL syntax. For example, listing all k8s jobs can be done simply:
select  name,  namespace,  active,  succeeded,  failed,  completions,  start_time,  completion_time,  age(coalesce(completion_time, current_timestamp), start_time) as duration,  active_deadline_seconds,  parallelism,  selector,  labels,  annotationsfrom  kubernetes_job;
List only the active jobs:
select  name,  namespace,  start_time,  age(coalesce(completion_time, current_timestamp), start_time) as duration,  active,  succeeded,  failedfrom  kubernetes_jobwhere active > 0;
A query to list all container statuses:
select  namespace,  name as pod_name,  phase,  cs ->> 'name' as container_name,  cs ->> 'image' as image,  cs ->> 'ready' as ready,  cs_state as state,  cs ->> 'started' as started,  cs ->> 'restartCount' as restartsfrom  kubernetes_pod,  jsonb_array_elements(container_statuses) as cs,  jsonb_object_keys(cs -> 'state') as cs_stateorder by  namespace,  name,  container_name;
A full description of all existing tables and official examples are provided here:
Blink supports this Steampipe version: v0.15.0.

Action Parameters

ParameterDescription
SQL statementThe SQL query to execute against database resources. Use standard SQL syntax.
Output formatThe representation of the output result. The possible options are “Table”, “CSV” or “JSON”.
RunAWSCloudQuery