CodexBloom - Programming Q&A Platform

Kubernetes DaemonSet Not Restarting Pods After Node Resource Reallocation in v1.29

👀 Views: 32 💬 Answers: 1 📅 Created: 2025-06-14
kubernetes daemonset resource-management yaml

I'm relatively new to this, so bear with me. I've spent hours debugging this and After trying multiple solutions online, I still can't figure this out..... I'm working with an scenario where my DaemonSet is not restarting the pods on a node after I manually reallocate resources on that node. I'm using Kubernetes v1.29, and my DaemonSet is configured to run a logging agent. I’ve set the resource limits in the DaemonSet spec like this: ```yaml apiVersion: apps/v1 kind: DaemonSet metadata: name: logging-agent spec: selector: matchLabels: app: logging-agent template: metadata: labels: app: logging-agent spec: containers: - name: agent image: logging-agent:latest resources: requests: memory: "64Mi" cpu: "250m" limits: memory: "128Mi" cpu: "500m" ``` After reallocating resources, I expected Kubernetes to restart the DaemonSet pods on that node to reflect the new limits. Instead, the pods remain in the running state without any change. I even tried deleting the pods manually, but they just come back up without applying the new resource configurations. For debugging, I checked the event logs for the DaemonSet but didn’t see any errors or warnings. Here’s what I ran: ```bash dkubectl describe daemonset logging-agent ``` This showed that the desired number of pods are running. I also confirmed that the node itself has enough resources available after the changes. However, when I look at the pods, they still have the old resource limits: ```bash kubectl get pods -l app=logging-agent -o jsonpath='{.items[*].spec.containers[*].resources}' ``` I’ve also tried using `kubectl rollout restart` on the DaemonSet, but that didn’t help. Is there a specific behavior of DaemonSets that I might not be aware of when it comes to resource allocation changes? How can I force the pods to restart and pick up the new resource limits? For context: I'm using Yaml on Linux. Am I missing something obvious? The stack includes Yaml and several other technologies. What's the best practice here? This is for a mobile app running on Linux. Thanks for your help in advance!