AKS monitoring settings need review

Missing AKS logs and metrics can make failures and unusual activity harder to investigate.

Description

To monitor AKS nodes and containers with Azure Monitor, connect Container Insights to a Log Analytics workspace. Collect Kubernetes API server audit logs separately through cluster diagnostic settings.

Potential impact

Without container logs and historical metrics, it can be hard to tell when a workload failed or resource use began to climb.

Remediation

Set addon.monitoring.enabled to yes and put the destination workspace ID in log_analytics_workspace_resource_id. Check collection permissions, then look for a recent container log and the metrics you need. Set retention and alerts to cover your investigation and monitoring needs.

Examples

Both tasks need a supported Kubernetes version and the rest of the cluster configuration, including node pools and authentication.

Before

yaml
- name: AKS 생성
  azure_rm_aks:
    name: myAKS
    resource_group: myResourceGroup
    location: eastus
    dns_prefix: akstest
    kubernetes_version: "{{ kubernetes_version }}"
    enable_rbac: yes

If you use another collector, check for the required logs and metrics there.

After

yaml
- name: AKS 생성
  azure_rm_aks:
    name: myAKS
    resource_group: myResourceGroup
    location: eastus
    dns_prefix: akstest
    kubernetes_version: "{{ kubernetes_version }}"
    enable_rbac: yes
    addon:
      monitoring:
        log_analytics_workspace_resource_id: "{{ log_analytics_workspace_resource_id }}"
        enabled: yes

References