Skip to content

Commit de2aa78

Browse files
committed
fix: remove NodeName from DaemonSet pod template
DaemonSet pods should not have NodeName set in their template spec. The DaemonSet controller manages pod placement based on nodeAffinity and other scheduling rules. Having NodeName hardcoded was forcing all DaemonSet pods to only run on one specific node, preventing the DaemonSet from functioning properly. This was causing: - Only one pod running instead of one per matching node - DaemonSet controller creating hundreds of pods trying to satisfy requirements - Pods unable to schedule on other matching nodes The fix removes the NodeName field from the pod template, allowing the DaemonSet controller to properly manage pod placement across all nodes that match the configured nodeAffinity.
1 parent 47d005e commit de2aa78

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pkg/juicefs/mount/builder/daemonset.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ func (d *DaemonSetBuilder) NewMountDaemonSet(dsName string) (*appsv1.DaemonSet,
4848
// Create template pod for DaemonSet
4949
pod := podBuilder.genCommonJuicePod(podBuilder.genCommonContainer)
5050
pod.Spec.RestartPolicy = corev1.RestartPolicyAlways
51+
// Remove NodeName from DaemonSet pod template - DaemonSet controller manages pod placement
52+
pod.Spec.NodeName = ""
5153

5254
// Generate mount command
5355
mountCmd := d.genMountCommand()

0 commit comments

Comments
 (0)