From 04305ef4a3128830dd409aae42df940166f684f5 Mon Sep 17 00:00:00 2001 From: Radostin Stoyanov Date: Thu, 22 Oct 2026 13:33:44 +0100 Subject: [PATCH] fix(helm): use cluster DNS for the node agent Signed-off-by: Radostin Stoyanov --- charts/snapshot/templates/daemonset.yaml | 1 + charts/snapshot/tests/daemonset_dns_test.yaml | 37 +++++++++++++++++++ docs/operations/security.md | 4 ++ 3 files changed, 42 insertions(+) create mode 100644 charts/snapshot/tests/daemonset_dns_test.yaml diff --git a/charts/snapshot/templates/daemonset.yaml b/charts/snapshot/templates/daemonset.yaml index 30e756272..58c9d960b 100644 --- a/charts/snapshot/templates/daemonset.yaml +++ b/charts/snapshot/templates/daemonset.yaml @@ -59,6 +59,7 @@ spec: hostPID: true hostIPC: true hostNetwork: true + dnsPolicy: ClusterFirstWithHostNet {{- with .Values.daemonset.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/charts/snapshot/tests/daemonset_dns_test.yaml b/charts/snapshot/tests/daemonset_dns_test.yaml new file mode 100644 index 000000000..ed56b4cb6 --- /dev/null +++ b/charts/snapshot/tests/daemonset_dns_test.yaml @@ -0,0 +1,37 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +suite: host-networked agent cluster DNS +templates: + - templates/daemonset.yaml +tests: + - it: resolves Kubernetes Services from the host network + asserts: + - equal: + path: spec.template.spec.hostNetwork + value: true + - equal: + path: spec.template.spec.dnsPolicy + value: ClusterFirstWithHostNet + + - it: retains cluster DNS for a remote metadata client + set: + operator.enabled: false + provenance.provider: + enabled: true + kubeconfigSecret: metadata-read-only + tlsSecret: webhook-tls + caBundle: dGVzdC1jYQ== + reflectorUsername: test-reflector + daemonset.nodeSelector: + kubernetes.io/hostname: node-a + daemonset.remoteControlPlane: + kubeconfigSecret: metadata-credentials + providerNamespace: offloaded + asserts: + - equal: + path: spec.template.spec.hostNetwork + value: true + - equal: + path: spec.template.spec.dnsPolicy + value: ClusterFirstWithHostNet diff --git a/docs/operations/security.md b/docs/operations/security.md index b74c541d3..495dc215d 100644 --- a/docs/operations/security.md +++ b/docs/operations/security.md @@ -13,6 +13,10 @@ Because of this, the agent's namespace must permit privileged pods. On clusters that enforce [Pod Security Standards](https://kubernetes.io/docs/concepts/security/pod-security-standards/), apply the `privileged` level (or an equivalent exception) to that namespace. +The agent uses `ClusterFirstWithHostNet` DNS policy so its host-networked Pod +can resolve Kubernetes Services. This also applies to a remote metadata API +exposed through a Service on a Liqo provider. + ## Seccomp CRIU requires a seccomp profile to perform checkpoint and restore. The Helm chart