Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## [master](https://github.com/arangodb/kube-arangodb/tree/master) (N/A)
- (Bugfix) (Platform) Fix Container Resource Adjustments
- (Bugfix) (Platform) Fix LM CLI Option
- (Bugfix) (Platform) Fix topology for Gateways

## [1.3.2](https://github.com/arangodb/kube-arangodb/tree/1.3.2) (2025-11-20)
- (Bugfix) (Platform) Increase memory limit for Inventory
Expand Down
9 changes: 8 additions & 1 deletion pkg/deployment/resources/pod_creator_gateway_pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
schedulerApi "github.com/arangodb/kube-arangodb/pkg/apis/scheduler/v1beta1"
shared "github.com/arangodb/kube-arangodb/pkg/apis/shared"
"github.com/arangodb/kube-arangodb/pkg/deployment/pod"
"github.com/arangodb/kube-arangodb/pkg/deployment/topology"
integrationsSidecar "github.com/arangodb/kube-arangodb/pkg/integrations/sidecar"
"github.com/arangodb/kube-arangodb/pkg/util/collection"
"github.com/arangodb/kube-arangodb/pkg/util/errors"
Expand Down Expand Up @@ -68,6 +69,8 @@ func (m *MemberGatewayPod) GetPodAntiAffinity() *core.PodAntiAffinity {

pod.AppendPodAntiAffinityDefault(m, a)

a = kresources.MergePodAntiAffinity(a, topology.GetTopologyAffinityRules(m.context.GetName(), m.Status, m.Group, m.Member).PodAntiAffinity)

a = kresources.MergePodAntiAffinity(a, m.GroupSpec.AntiAffinity)

return kresources.OptionalPodAntiAffinity(a)
Expand All @@ -76,10 +79,12 @@ func (m *MemberGatewayPod) GetPodAntiAffinity() *core.PodAntiAffinity {
func (m *MemberGatewayPod) GetPodAffinity() *core.PodAffinity {
a := &core.PodAffinity{}

pod.AppendAffinityWithRole(m, a, api.ServerGroupDBServers.AsRole())
pod.AppendAffinityWithRole(m, a, api.ServerGroupCoordinators.AsRole())

a = kresources.MergePodAffinity(a, m.GroupSpec.Affinity)

a = kresources.MergePodAffinity(a, topology.GetTopologyAffinityRules(m.context.GetName(), m.Status, m.Group, m.Member).PodAffinity)

Comment on lines 81 to +87
Copy link

Copilot AI Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ordering of affinity rule merging is inconsistent with the pattern used in MemberArangoDPod.GetPodAffinity() (lines 354-356 in pod_creator_arangod.go). In ArangoDPod, GroupSpec.Affinity is merged before topology rules, but here topology rules are merged after GroupSpec.Affinity. For consistency and to ensure GroupSpec rules can override topology rules, the topology merge should happen at line 84 (before GroupSpec.Affinity).

Suggested change
a = kresources.MergePodAffinity(a, m.GroupSpec.Affinity)
a = kresources.MergePodAffinity(a, topology.GetTopologyAffinityRules(m.context.GetName(), m.Status, m.Group, m.Member).PodAffinity)
a = kresources.MergePodAffinity(a, topology.GetTopologyAffinityRules(m.context.GetName(), m.Status, m.Group, m.Member).PodAffinity)
a = kresources.MergePodAffinity(a, m.GroupSpec.Affinity)

Copilot uses AI. Check for mistakes.
return kresources.OptionalPodAffinity(a)
}

Expand All @@ -90,6 +95,8 @@ func (m *MemberGatewayPod) GetNodeAffinity() *core.NodeAffinity {

a = kresources.MergeNodeAffinity(a, m.GroupSpec.NodeAffinity)

a = kresources.MergeNodeAffinity(a, topology.GetTopologyAffinityRules(m.context.GetName(), m.Status, m.Group, m.Member).NodeAffinity)

return kresources.OptionalNodeAffinity(a)
}

Expand Down