0
votes

I have an AKS (Azure Kubernetes) cluster with a few different namespaces. In one of them I have many different pods, each runs only one container.

Azure collects the data and ingest it to Log Analytics.

The problem is that in one of the namespaces I'm running nginx-ingress, which creates a lot of sttout logs.

I want to stop ingesting those logs to the Log Analytics, or even disable them totally (of course that I prefer to keep them in the pod itself).

I could only find a way to disable the entire namespace from collecting the logs, but I need to disable only this specific pod (that been created from a deployment/replicaset).

1

1 Answers

0
votes

so a reasonable approach would be to put nginx-ingress into a separate namespace and dont gather logs from that namespace at all:

[log_collection_settings.stdout]          
   enabled = true          
   exclude_namespaces = ["kube-system", "nginx-ingress"]

you can edit this configmap:

name: container-azm-ms-agentconfig
namespace: kube-system

Reading:
https://github.com/microsoft/OMS-docker/blob/ci_feature_prod/Kubernetes/container-azm-ms-agentconfig.yaml
https://docs.microsoft.com/en-us/azure/azure-monitor/insights/container-insights-agent-config
https://medium.com/microsoftazure/azure-monitor-for-containers-optimizing-data-collection-settings-for-cost-ce6f848aca32

an alternative, would be to stop ingesting stdout log, only stderr