turbot/kubernetes_insights

Query: configmaps_for_container

Usage

powerpipe query kubernetes_insights.query.configmaps_for_container

SQL

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