Control: Kubernetes clusters should use a minimum number of 50 pods
Description
This control checks if Kubernetes cluster is using a minimum number of 50 pods.
Usage
Run the control in your terminal:
powerpipe control run terraform_azure_compliance.control.kubernetes_cluster_max_pod_50Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run terraform_azure_compliance.control.kubernetes_cluster_max_pod_50 --shareSQL
This control uses a named query:
select  address as resource,  case    when (type = 'azurerm_kubernetes_cluster' and (attributes_std -> 'default_node_pool' -> 'max_pods') is null)      or (type = 'azurerm_kubernetes_cluster_node_pool' and (attributes_std -> 'max_pods') is null ) then 'alarm'    when type = 'azurerm_kubernetes_cluster_node_pool' and (attributes_std ->> 'max_pods')::int >= 50 then 'ok'    when type = 'azurerm_kubernetes_cluster' and (attributes_std -> 'default_node_pool' ->> 'max_pods')::int >= 50 then 'ok'    else 'alarm'  end status,  split_part(address, '.', 2) || case    when      (type = 'azurerm_kubernetes_cluster' and (attributes_std -> 'default_node_pool' -> 'max_pods') is null)      or (type = 'azurerm_kubernetes_cluster_node_pool' and (attributes_std -> 'max_pods') is null ) then ' max pods not defined'    when type = 'azurerm_kubernetes_cluster_node_pool' then ' has ' || (attributes_std ->> 'max_pods') || ' pods'    when type = 'azurerm_kubernetes_cluster' then ' has ' || (attributes_std -> 'default_node_pool' ->> 'max_pods') || ' pods'  end || '.' reason    , path || ':' || start_linefrom  terraform_resourcewhere  type  in ('azurerm_kubernetes_cluster', 'azurerm_kubernetes_cluster_node_pool');