turbot/kubernetes_insights

Query: kubernetes_cluster_resources

Usage

powerpipe query kubernetes_insights.query.kubernetes_cluster_resources

SQL

select
distinct resource as label,
resource as value,
resource
from
kubernetes_role,
jsonb_array_elements(rules) as r,
jsonb_array_elements_text(r->'resources') as resource
where
context_name in (select unnest (string_to_array($1, ',')::text[]))
union
select
distinct resource as label,
resource as value,
resource
from
kubernetes_cluster_role,
jsonb_array_elements(rules) as r,
jsonb_array_elements_text(r->'resources') as resource
where
context_name in (select unnest (string_to_array($1, ',')::text[]))
order by
resource;

Params

ArgsNameDefaultDescriptionVariable
$1cluster_context