[BUG] Azure AKS Automatic cluster blocks deploying OpenTelemetry Collector DaemonSet due to Deployment Safeguards
Describe the bug
I’m using an AKS Automatic cluster and trying to deploy the OpenTelemetry Collector as a DaemonSet. The deployment fails because AKS Automatic enforces Deployment Safeguards that block any Pod using HostPath volumes. Since the OTEL agent needs HostPath access to read node logs, the Pod is rejected every time.
I also found that these safeguards cannot be changed, excluded, or disabled on Automatic clusters, so there seems to be no supported way to run a HostPath-based logging agent.
Problem Details
The OTEL DaemonSet needs the following HostPath mounts:
- /var/log/pods
- /var/lib/docker/containers
- / (host fs)
The cluster blocks the Pod with this error:
ValidatingAdmissionPolicy 'aks-managed-baseline-hostpath-volumes' denied request: HostPath volumes detected: [varlogpods, varlibdockercontainers, hostfs] HostPath volumes are forbidden under restricted security policy unless containers mounting them are from allowed images.
The allowed images list only includes Microsoft system images.
Our image: ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib is not allowed, so the deployment is denied.
What I’ve Tried
-
Editing the ValidatingAdmissionPolicy I added our image to allowedImages, but AKS Automatic reverted the policy back to default within a few minutes.
-
Excluding our namespace from safeguards Using: az aks safeguards update --excluded-ns otel-agent
It fails with: RequestNotAllowedBecauseAssociatedClusterIsAutomaticCluster
So namespace exclusions aren’t allowed on Automatic SKU.
- Checked the policy assignment
The assignment is owned and controlled by AKS and not editable.
- Edited via kubectl
Changes were applied but automatically reverted by AKS.
To Reproduce
Steps to reproduce the issue:
-
Deploy OpenTelemetry Collector DaemonSet (or any DaemonSet using HostPath)
-
AKS immediately rejects the Pod with:
ValidatingAdmissionPolicy 'aks-managed-baseline-hostpath-volumes' denied request: HostPath volumes detected: [...] HostPath volumes are forbidden under restricted security policy unless containers mounting them are from allowed images. -
Try updating safeguards:
az aks safeguards update --excluded-ns otel-agent -
See error:
RequestNotAllowedBecauseAssociatedClusterIsAutomaticCluster -
Try editing the ValidatingAdmissionPolicy → AKS reverts it within minutes
Expected behavior
I expected to be able to:
- Allow HostPath mounts for a specific namespace (
otel-agent) - OR allowlist the OTEL image in the policy
- OR disable or adjust the safeguard
- OR have a supported way to run a logging agent that needs HostPath volumes
Instead, all override attempts are blocked.
Screenshots
(Example from ArgoCD)
Environment
- CLI Version: Azure CLI 2.66.0
- Kubernetes Version: 1.32+
- Cluster SKU:
automatic - Region: eastus
- Agent Image:
ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib
Additional context
- The admission policy
aks-managed-baseline-hostpath-volumesis automatically created and managed by AKS. - The allowed images list only includes Microsoft-managed system images.
- Any changes made via
kubectl editare automatically reverted. - Namespace exclusion using
az aks safeguards updateis blocked for Automatic clusters.
Because of this, all HostPath-based logging agents appear to be unsupported on AKS Automatic, but this is not clearly documented.
We need clarification on whether:
Is there any supported way to run a HostPath-based logging agent on AKS Automatic? Is the inability to exclude namespaces expected? If not, is this a bug? Are HostPath mounts officially unsupported on AKS Automatic? If yes: What is the recommended logging/observability pattern for Automatic clusters?
If this is a bug or misconfiguration, please advise or escalate.
Hi @aritraghosh , @julia-yin , @AllenWen-at-Azure
Do we have any update on this?
Is it a bug or a limitation with automatic AKS cluster?
Hello @Satheeshkumar433 . Thanks for raising this. AKS Automatic enforces pod security standards that block components requiring restricted capabilities like hostPath or hostPort. This affects observability stacks such as OpenTelemetry and DataDog. OpenTelemetry has alternate solutions such as OTel Gateway and auto instrumentation that can be explored. Auto instrumentation works via sidecars instead of host-level access. Container Insights is another option you can use with Automatic.
If you want to continue with your current monitoring stack, you can consider using AKS Standard since it doesn’t enforce the same restrictions. You would be able to have more granular control.
again
Is this a Won't Fix issue or has MSFT got any intention of looking at this?