turbot/kubernetes_insights

Query: daemonset_tree

Usage

powerpipe query kubernetes_insights.query.daemonset_tree

SQL

-- This daemonset
select
null as from_id,
uid as id,
name as title,
0 as depth,
'job' as category
from
kubernetes_daemonset
where
uid = $1 -- Pods owned by the daemonset
union all
select
pod_owner ->> 'uid' as from_id,
pod.uid as id,
pod.name as title,
1 as depth,
'pod' as category
from
kubernetes_pod as pod,
jsonb_array_elements(pod.owner_references) as pod_owner
where
pod_owner ->> 'uid' = $1 -- containers in Pods owned by the daemonset
union all
select
pod.uid as from_id,
concat(pod.uid, '_', container ->> 'name') as id,
container ->> 'name' as title,
2 as depth,
'container' as category
from
kubernetes_pod as pod,
jsonb_array_elements(pod.owner_references) as pod_owner,
jsonb_array_elements(pod.containers) as container
where
pod_owner ->> 'uid' = $1

Params

ArgsNameDefaultDescriptionVariable
$1uid

    Dashboards

    The query is used in the dashboards: