turbot/kubernetes_insights

Query: containers_for_job

Usage

powerpipe query kubernetes_insights.query.containers_for_job

SQL

select
container ->> 'name' || pod.name as name
from
kubernetes_job as j,
kubernetes_pod as pod,
jsonb_array_elements(pod.owner_references) as pod_owner,
jsonb_array_elements(pod.containers) as container
where
j.uid = $1
and j.context_name = pod.context_name
and pod_owner ->> 'uid' = j.uid;