turbot/kubernetes_insights

Query: replicasets_for_service

Usage

powerpipe query kubernetes_insights.query.replicasets_for_service

SQL

select
pod_owner ->> 'uid' as uid
from
kubernetes_pod as pod,
jsonb_array_elements(pod.owner_references) as pod_owner,
kubernetes_service as s
where
s.uid = $1
and s.context_name = pod.context_name
and pod.selector_search = s.selector_query;