# from https://raw.githubusercontent.com/mspnp/aks-secure-baseline/main/cluster-manifests/kube-system/container-azm-ms-agentconfig.yaml
apiVersion: v1
kind: ConfigMap
metadata:
   name: container-azm-ms-agentconfig
   namespace: kube-system
data:
   # https://raw.githubusercontent.com/microsoft/Docker-Provider/ci_prod/kubernetes/container-azm-ms-agentconfig.yaml
   schema-version: v1
   config-version: ver1
   log-data-collection-settings: |-
      [log_collection_settings]
         [log_collection_settings.stdout]
            enabled = true
            exclude_namespaces = ["kube-system"]
         [log_collection_settings.stderr]
            enabled = true
            exclude_namespaces = ["kube-system"]
         [log_collection_settings.env_var]
            enabled = true
         [log_collection_settings.enrich_container_logs]
            enabled = false
         [log_collection_settings.collect_all_kube_events]
            enabled = false
   prometheus-data-collection-settings: |-
      [prometheus_data_collection_settings.cluster]
          interval = "1m"
          monitor_kubernetes_pods = true
          monitor_kubernetes_pods_namespaces = ["demos","cluster-baseline-settings"]
      [prometheus_data_collection_settings.node]
          interval = "1m"
          urls = ["http://$NODE_IP:9103/metrics"]
   metric_collection_settings: |-
      [metric_collection_settings.collect_kube_system_pv_metrics]
          enabled = true
   alertable-metrics-configuration-settings: |-
      [alertable_metrics_configuration_settings.container_resource_utilization_thresholds]
          container_cpu_threshold_percentage = 90.0
          container_memory_rss_threshold_percentage = 90.0
          container_memory_working_set_threshold_percentage = 90.0
      [alertable_metrics_configuration_settings.pv_utilization_thresholds]
          pv_usage_threshold_percentage = 75.0
   integrations: |-
      [integrations.azure_network_policy_manager]
          collect_basic_metrics = true
          collect_advanced_metrics = false
