mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-08-08 11:59:17 +00:00
Change the affinity to be valid when we are tapping multiple nodes (#1023)
This commit is contained in:
parent
d834fcc3cb
commit
de533730d3
@ -805,14 +805,20 @@ func (provider *Provider) ApplyMizuTapperDaemonSet(ctx context.Context, namespac
|
|||||||
agentResources := applyconfcore.ResourceRequirements().WithRequests(agentResourceRequests).WithLimits(agentResourceLimits)
|
agentResources := applyconfcore.ResourceRequirements().WithRequests(agentResourceRequests).WithLimits(agentResourceLimits)
|
||||||
agentContainer.WithResources(agentResources)
|
agentContainer.WithResources(agentResources)
|
||||||
|
|
||||||
nodeSelectorRequirement := applyconfcore.NodeSelectorRequirement()
|
matchFields := make([]*applyconfcore.NodeSelectorTermApplyConfiguration, 0)
|
||||||
nodeSelectorRequirement.WithKey("metadata.name")
|
for _, nodeName := range nodeNames {
|
||||||
nodeSelectorRequirement.WithOperator(core.NodeSelectorOpIn)
|
nodeSelectorRequirement := applyconfcore.NodeSelectorRequirement()
|
||||||
nodeSelectorRequirement.WithValues(nodeNames...)
|
nodeSelectorRequirement.WithKey("metadata.name")
|
||||||
nodeSelectorTerm := applyconfcore.NodeSelectorTerm()
|
nodeSelectorRequirement.WithOperator(core.NodeSelectorOpIn)
|
||||||
nodeSelectorTerm.WithMatchFields(nodeSelectorRequirement)
|
nodeSelectorRequirement.WithValues(nodeName)
|
||||||
|
|
||||||
|
nodeSelectorTerm := applyconfcore.NodeSelectorTerm()
|
||||||
|
nodeSelectorTerm.WithMatchFields(nodeSelectorRequirement)
|
||||||
|
matchFields = append(matchFields, nodeSelectorTerm)
|
||||||
|
}
|
||||||
|
|
||||||
nodeSelector := applyconfcore.NodeSelector()
|
nodeSelector := applyconfcore.NodeSelector()
|
||||||
nodeSelector.WithNodeSelectorTerms(nodeSelectorTerm)
|
nodeSelector.WithNodeSelectorTerms(matchFields...)
|
||||||
nodeAffinity := applyconfcore.NodeAffinity()
|
nodeAffinity := applyconfcore.NodeAffinity()
|
||||||
nodeAffinity.WithRequiredDuringSchedulingIgnoredDuringExecution(nodeSelector)
|
nodeAffinity.WithRequiredDuringSchedulingIgnoredDuringExecution(nodeSelector)
|
||||||
affinity := applyconfcore.Affinity()
|
affinity := applyconfcore.Affinity()
|
||||||
|
Loading…
Reference in New Issue
Block a user