turbot/kubernetes_insights

Query: pod_persistent_volume_claims

Usage

powerpipe query kubernetes_insights.query.pod_persistent_volume_claims

SQL

select
distinct c.uid as uid
from
kubernetes_pod as p,
jsonb_array_elements(volumes) as v
left join kubernetes_persistent_volume_claim as c
on v -> 'persistentVolumeClaim' ->> 'claimName' = c.name
where
c.uid is not null
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.context_name = c.context_name
and p.uid = $1;