Open BenjaminHuang opened 5 months ago
I suspect the manifest value needs to be increased to match what the operator is setting, and to enable the preStop hook to run.
If terminationGracePeriodSeconds set to non-zero pre-stop hook will cause NetworkUnavailable status set:
Does this look like it's expected? If so, we need to adjust the manifest value to 5.
If terminationGracePeriodSeconds set to non-zero pre-stop hook will cause NetworkUnavailable status set:
Does this look like it's expected? If so, we need to adjust the manifest value to 5.
that depends on your situation
I suspect the manifest value needs to be increased to match what the operator is setting, and to enable the preStop hook to run.
I'm not sure whether setting both to positive value would be better.
I guess by adding a commet above this parameter, describing the impact to node status , would be good enough.
Without that, it'd be hard to imagine what happen when changing it, you have to dig out more details from source code.
if you have all pods on host network, and just want to delete calico-node from cluster, leave it as zero would be nice
Agreed, although I would classify this as an exceptional case and far from the expected scenario in 90% of Kubernetes clusters using Calico.
I think we should:
I am having the same issue. preStop is ignored when I set the terminationGracePeriodSeconds value to 0. I have increased the value to 10, and it seems to work now.
Calico version 3.28.0 Orchestrator version: kubernetes v1.30.5 + containerd://1.6.33 Operating System and version: Debian Buster
The calico-node daemonset has terminationGracePeriodSeconds set.
In the manifest version, it's coded as 0:
terminationGracePeriodSeconds: 0
But in the version generated by tigera-operator, it's coded as 5:
terminationGracePeriodSeconds: 5
However, both versions have prestop hook specified
If terminationGracePeriodSeconds set to 0 pre-stop hook will be unreachable, this makes the impact of calico-node deletion minimized.
If terminationGracePeriodSeconds set to non-zero pre-stop hook will cause NetworkUnavailable status set:
and eventually cause a no-schedule taint added by kube-controller-manager:
However, I'm not sure which is the desired behavior.
Expected Behavior
terminationGracePeriodSeconds should be consistent in calico-node daemonset, both in manifest and tigera-operator-generated version.
Current Behavior
terminationGracePeriodSeconds is inconsistent in calico-node daemonset, between manifest and tigera-operator-generated version.
Possible Solution
set terminationGracePeriodSeconds to 0 in different version of calico-node daemonset
Steps to Reproduce (for bugs)
Context
I want calico installation from manifest or from tigera operator has the same behavior, in calico-node deletion.
Your Environment