From 26a2600ccdcbd34532de0c1427c71ad42b3453c3 Mon Sep 17 00:00:00 2001 From: Rohan Gupta Date: Thu, 26 Mar 2026 13:11:46 +0530 Subject: [PATCH] driver: set correct DNSPolicy based on HostNetwork for ctrl plugins In case of data replication separation, Controller Plugins needs to run on hostNetwork and the DNS policy should be set to ClusterFirstWithHostNetwork Signed-off-by: Rohan Gupta --- internal/controller/driver_controller.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/internal/controller/driver_controller.go b/internal/controller/driver_controller.go index abffd008..c2eb4ce2 100644 --- a/internal/controller/driver_controller.go +++ b/internal/controller/driver_controller.go @@ -597,8 +597,14 @@ func (r *driverReconcile) reconcileControllerPluginDeployment() error { ServiceAccountName: serviceAccountName, PriorityClassName: ptr.Deref(pluginSpec.PrioritylClassName, ""), HostNetwork: ptr.Deref(pluginSpec.HostNetwork, false), - Affinity: getControllerPluginPodAffinity(pluginSpec, &appSelector), - Tolerations: pluginSpec.Tolerations, + DNSPolicy: utils.Call(func() corev1.DNSPolicy { + if ptr.Deref(pluginSpec.HostNetwork, false) { + return corev1.DNSClusterFirstWithHostNet + } + return corev1.DNSClusterFirst + }), + Affinity: getControllerPluginPodAffinity(pluginSpec, &appSelector), + Tolerations: pluginSpec.Tolerations, Containers: utils.Call(func() []corev1.Container { containers := []corev1.Container{ // Plugin Container