turbot/kubernetes_insights

Query: nodes_for_deployment

Usage

powerpipe query kubernetes_insights.query.nodes_for_deployment

SQL

select
n.uid as uid
from
kubernetes_replicaset as rs,
jsonb_array_elements(rs.owner_references) as rs_owner,
kubernetes_pod as pod,
jsonb_array_elements(pod.owner_references) as pod_owner,
kubernetes_node as n
where
n.name = pod.node_name
and rs.context_name = n.context_name
and rs_owner ->> 'uid' = $1
and pod_owner ->> 'uid' = rs.uid;