turbot/kubernetes_insights

Query: configmaps_for_pod

Usage

powerpipe query kubernetes_insights.query.configmaps_for_pod

SQL

select
c.uid as uid
from
kubernetes_pod as p,
jsonb_array_elements(volumes) as v
left join kubernetes_config_map as c
on v -> 'configMap' ->> 'name' = c.name
where
c.uid is not null
and p.context_name = c.context_name
and v ->> 'name' in
(select
v ->> 'name'
from kubernetes_pod,
jsonb_array_elements(containers) as c,
jsonb_array_elements(c -> 'volumeMounts') as v)
and p.uid = $1;