diff --git a/CHANGELOG.md b/CHANGELOG.md index f51ae0970..37b8db009 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - (Feature) Chart By Tag filter - (Feature) Add Gateway Config condition - (Bugfix) Fix AnyPB Parsing in Meta Service +- (Feature) Add Arch Tolerations ## [1.3.0](https://github.com/arangodb/kube-arangodb/tree/1.3.0) (2025-08-01) - (Feature) (Platform) Storage Debug diff --git a/chart/kube-arangodb-arm64/templates/deployment.yaml b/chart/kube-arangodb-arm64/templates/deployment.yaml index 6540982dd..21574860c 100644 --- a/chart/kube-arangodb-arm64/templates/deployment.yaml +++ b/chart/kube-arangodb-arm64/templates/deployment.yaml @@ -264,6 +264,9 @@ spec: operator: "Exists" effect: "NoExecute" tolerationSeconds: 5 + - key: "kubernetes.io/arch" + operator: "Exists" + effect: "NoSchedule" {{- if .Values.operator.tolerations }} {{ toYaml .Values.operator.tolerations | indent 8 }} {{- end }} diff --git a/chart/kube-arangodb-enterprise-arm64/templates/deployment.yaml b/chart/kube-arangodb-enterprise-arm64/templates/deployment.yaml index 6540982dd..21574860c 100644 --- a/chart/kube-arangodb-enterprise-arm64/templates/deployment.yaml +++ b/chart/kube-arangodb-enterprise-arm64/templates/deployment.yaml @@ -264,6 +264,9 @@ spec: operator: "Exists" effect: "NoExecute" tolerationSeconds: 5 + - key: "kubernetes.io/arch" + operator: "Exists" + effect: "NoSchedule" {{- if .Values.operator.tolerations }} {{ toYaml .Values.operator.tolerations | indent 8 }} {{- end }} diff --git a/chart/kube-arangodb-enterprise/templates/deployment.yaml b/chart/kube-arangodb-enterprise/templates/deployment.yaml index 6540982dd..21574860c 100644 --- a/chart/kube-arangodb-enterprise/templates/deployment.yaml +++ b/chart/kube-arangodb-enterprise/templates/deployment.yaml @@ -264,6 +264,9 @@ spec: operator: "Exists" effect: "NoExecute" tolerationSeconds: 5 + - key: "kubernetes.io/arch" + operator: "Exists" + effect: "NoSchedule" {{- if .Values.operator.tolerations }} {{ toYaml .Values.operator.tolerations | indent 8 }} {{- end }} diff --git a/chart/kube-arangodb/templates/deployment.yaml b/chart/kube-arangodb/templates/deployment.yaml index 6540982dd..21574860c 100644 --- a/chart/kube-arangodb/templates/deployment.yaml +++ b/chart/kube-arangodb/templates/deployment.yaml @@ -264,6 +264,9 @@ spec: operator: "Exists" effect: "NoExecute" tolerationSeconds: 5 + - key: "kubernetes.io/arch" + operator: "Exists" + effect: "NoSchedule" {{- if .Values.operator.tolerations }} {{ toYaml .Values.operator.tolerations | indent 8 }} {{- end }} diff --git a/pkg/deployment/images.go b/pkg/deployment/images.go index 76c2eb3b5..0296b8325 100644 --- a/pkg/deployment/images.go +++ b/pkg/deployment/images.go @@ -338,6 +338,8 @@ func (i *ImageUpdatePod) GetTolerations() []core.Toleration { } } + ts = tolerations.AddTolerationIfNotFound(ts, + tolerations.NewNoScheduleToleration(tolerations.TolerationArchitecture, tolerations.TolerationDuration{Forever: true})) ts = tolerations.AddTolerationIfNotFound(ts, tolerations.NewNoExecuteToleration(tolerations.TolerationKeyNodeNotReady, shortDur)) ts = tolerations.AddTolerationIfNotFound(ts, diff --git a/pkg/deployment/images_test.go b/pkg/deployment/images_test.go index 004da9bf9..feda2c37b 100644 --- a/pkg/deployment/images_test.go +++ b/pkg/deployment/images_test.go @@ -535,6 +535,7 @@ func getTestTolerations() []core.Toleration { } return []core.Toleration{ + tolerations.NewNoScheduleToleration(tolerations.TolerationArchitecture, tolerations.TolerationDuration{Forever: true}), tolerations.NewNoExecuteToleration(tolerations.TolerationKeyNodeNotReady, shortDur), tolerations.NewNoExecuteToleration(tolerations.TolerationKeyNodeUnreachable, shortDur), tolerations.NewNoExecuteToleration(tolerations.TolerationKeyNodeAlphaUnreachable, shortDur), diff --git a/pkg/deployment/resources/pod_creator_tolerations.go b/pkg/deployment/resources/pod_creator_tolerations.go index 422d1af78..4703605ef 100644 --- a/pkg/deployment/resources/pod_creator_tolerations.go +++ b/pkg/deployment/resources/pod_creator_tolerations.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2024 ArangoDB GmbH, Cologne, Germany +// Copyright 2024-2025 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -61,8 +61,10 @@ func CreatePodTolerations(mode api.DeploymentMode, group api.ServerGroup) []core notReadyDur.TimeSpan = 15 * time.Second unreachableDur.TimeSpan = 15 * time.Second } - return []core.Toleration{tolerations.NewNoExecuteToleration(tolerations.TolerationKeyNodeNotReady, notReadyDur), + return []core.Toleration{ + tolerations.NewNoExecuteToleration(tolerations.TolerationKeyNodeNotReady, notReadyDur), tolerations.NewNoExecuteToleration(tolerations.TolerationKeyNodeUnreachable, unreachableDur), tolerations.NewNoExecuteToleration(tolerations.TolerationKeyNodeAlphaUnreachable, unreachableDur), + tolerations.NewNoScheduleToleration(tolerations.TolerationArchitecture, tolerations.TolerationDuration{Forever: true}), } } diff --git a/pkg/util/k8sutil/tolerations/tolerations.go b/pkg/util/k8sutil/tolerations/tolerations.go index 0cc4cf2f0..605e8dc97 100644 --- a/pkg/util/k8sutil/tolerations/tolerations.go +++ b/pkg/util/k8sutil/tolerations/tolerations.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2025 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ import ( ) const ( + TolerationArchitecture = "kubernetes.io/arch" TolerationKeyNodeNotReady = "node.kubernetes.io/not-ready" TolerationKeyNodeAlphaUnreachable = "node.alpha.kubernetes.io/unreachable" TolerationKeyNodeUnreachable = "node.kubernetes.io/unreachable" @@ -44,7 +45,22 @@ func NewNoExecuteToleration(key string, duration TolerationDuration) core.Tolera t := core.Toleration{ Key: key, Operator: "Exists", - Effect: "NoExecute", + Effect: core.TaintEffectNoExecute, + } + if !duration.Forever { + tolerationSeconds := int64(duration.TimeSpan.Seconds()) + t.TolerationSeconds = &tolerationSeconds + } + return t +} + +// NewNoScheduleToleration is a helper to create a Toleration with +// Key=key, Operator='Exists' Effect='NoSchedule', TolerationSeconds=tolerationDuration.Seconds(). +func NewNoScheduleToleration(key string, duration TolerationDuration) core.Toleration { + t := core.Toleration{ + Key: key, + Operator: "Exists", + Effect: core.TaintEffectNoSchedule, } if !duration.Forever { tolerationSeconds := int64(duration.TimeSpan.Seconds())