Skip to content

[Feature] Manual Upgrade Mode #1918

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 1, 2025
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 @@ -7,6 +7,7 @@
- (Feature) (Platform) Service Handler
- (Feature) (Platform) Service Handler Implementation
- (Feature) (Platform) Packer
- (Feature) Manual Upgrade Mode

## [1.2.49](https://github.com/arangodb/kube-arangodb/tree/1.2.49) (2025-06-17)
- (Maintenance) Optimize go.mod
Expand Down
119 changes: 105 additions & 14 deletions docs/api/ArangoDeployment.V1.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,18 @@ LabelsMode Define labels mode which should be use while overriding labels

***

### .spec.agents.manualUpgradeMode

Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.49/pkg/apis/deployment/v1/server_group_spec.go#L224)</sup>

UpgradeMode Defines the manually triggered upgrade mode for the Member

Possible Values:
* `"inplace"` (default) - Inplace Upgrade procedure (with Upgrade initContainer)
* `"replace"` - Replaces server instead of upgrading. Takes an effect only on DBServer

***

### .spec.agents.maxCount

Type: `integer` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.49/pkg/apis/deployment/v1/server_group_spec.go#L50)</sup>
Expand Down Expand Up @@ -611,7 +623,7 @@ Links:

### .spec.agents.restartPolicy

Type: `core.RestartPolicy` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.49/pkg/apis/deployment/v1/server_group_spec.go#L224)</sup>
Type: `core.RestartPolicy` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.49/pkg/apis/deployment/v1/server_group_spec.go#L231)</sup>

RestartPolicy for all pods within the group.

Expand Down Expand Up @@ -852,13 +864,14 @@ Links:

### .spec.agents.upgradeMode

Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.49/pkg/apis/deployment/v1/server_group_spec.go#L217)</sup>
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.49/pkg/apis/deployment/v1/server_group_spec.go#L218)</sup>

UpgradeMode Defines the upgrade mode for the Member

Possible Values:
* `"inplace"` (default) - Inplace Upgrade procedure (with Upgrade initContainer)
* `"replace"` - Replaces server instead of upgrading. Takes an effect only on DBServer
* `"manual"` - Waits for the manual upgrade. Requires replacement or the annotation on the member

***

Expand Down Expand Up @@ -1327,6 +1340,18 @@ LabelsMode Define labels mode which should be use while overriding labels

***

### .spec.coordinators.manualUpgradeMode

Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.49/pkg/apis/deployment/v1/server_group_spec.go#L224)</sup>

UpgradeMode Defines the manually triggered upgrade mode for the Member

Possible Values:
* `"inplace"` (default) - Inplace Upgrade procedure (with Upgrade initContainer)
* `"replace"` - Replaces server instead of upgrading. Takes an effect only on DBServer

***

### .spec.coordinators.maxCount

Type: `integer` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.49/pkg/apis/deployment/v1/server_group_spec.go#L50)</sup>
Expand Down Expand Up @@ -1708,7 +1733,7 @@ Links:

### .spec.coordinators.restartPolicy

Type: `core.RestartPolicy` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.49/pkg/apis/deployment/v1/server_group_spec.go#L224)</sup>
Type: `core.RestartPolicy` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.49/pkg/apis/deployment/v1/server_group_spec.go#L231)</sup>

RestartPolicy for all pods within the group.

Expand Down Expand Up @@ -1949,13 +1974,14 @@ Links:

### .spec.coordinators.upgradeMode

Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.49/pkg/apis/deployment/v1/server_group_spec.go#L217)</sup>
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.49/pkg/apis/deployment/v1/server_group_spec.go#L218)</sup>

UpgradeMode Defines the upgrade mode for the Member

Possible Values:
* `"inplace"` (default) - Inplace Upgrade procedure (with Upgrade initContainer)
* `"replace"` - Replaces server instead of upgrading. Takes an effect only on DBServer
* `"manual"` - Waits for the manual upgrade. Requires replacement or the annotation on the member

***

Expand Down Expand Up @@ -2292,6 +2318,18 @@ LabelsMode Define labels mode which should be use while overriding labels

***

### .spec.dbservers.manualUpgradeMode

Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.49/pkg/apis/deployment/v1/server_group_spec.go#L224)</sup>

UpgradeMode Defines the manually triggered upgrade mode for the Member

Possible Values:
* `"inplace"` (default) - Inplace Upgrade procedure (with Upgrade initContainer)
* `"replace"` - Replaces server instead of upgrading. Takes an effect only on DBServer

***

### .spec.dbservers.maxCount

Type: `integer` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.49/pkg/apis/deployment/v1/server_group_spec.go#L50)</sup>
Expand Down Expand Up @@ -2673,7 +2711,7 @@ Links:

### .spec.dbservers.restartPolicy

Type: `core.RestartPolicy` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.49/pkg/apis/deployment/v1/server_group_spec.go#L224)</sup>
Type: `core.RestartPolicy` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.49/pkg/apis/deployment/v1/server_group_spec.go#L231)</sup>

RestartPolicy for all pods within the group.

Expand Down Expand Up @@ -2914,13 +2952,14 @@ Links:

### .spec.dbservers.upgradeMode

Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.49/pkg/apis/deployment/v1/server_group_spec.go#L217)</sup>
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.49/pkg/apis/deployment/v1/server_group_spec.go#L218)</sup>

UpgradeMode Defines the upgrade mode for the Member

Possible Values:
* `"inplace"` (default) - Inplace Upgrade procedure (with Upgrade initContainer)
* `"replace"` - Replaces server instead of upgrading. Takes an effect only on DBServer
* `"manual"` - Waits for the manual upgrade. Requires replacement or the annotation on the member

***

Expand Down Expand Up @@ -3478,6 +3517,18 @@ LabelsMode Define labels mode which should be use while overriding labels

***

### .spec.gateways.manualUpgradeMode

Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.49/pkg/apis/deployment/v1/server_group_spec.go#L224)</sup>

UpgradeMode Defines the manually triggered upgrade mode for the Member

Possible Values:
* `"inplace"` (default) - Inplace Upgrade procedure (with Upgrade initContainer)
* `"replace"` - Replaces server instead of upgrading. Takes an effect only on DBServer

***

### .spec.gateways.maxCount

Type: `integer` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.49/pkg/apis/deployment/v1/server_group_spec.go#L50)</sup>
Expand Down Expand Up @@ -3859,7 +3910,7 @@ Links:

### .spec.gateways.restartPolicy

Type: `core.RestartPolicy` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.49/pkg/apis/deployment/v1/server_group_spec.go#L224)</sup>
Type: `core.RestartPolicy` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.49/pkg/apis/deployment/v1/server_group_spec.go#L231)</sup>

RestartPolicy for all pods within the group.

Expand Down Expand Up @@ -4100,13 +4151,14 @@ Links:

### .spec.gateways.upgradeMode

Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.49/pkg/apis/deployment/v1/server_group_spec.go#L217)</sup>
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.49/pkg/apis/deployment/v1/server_group_spec.go#L218)</sup>

UpgradeMode Defines the upgrade mode for the Member

Possible Values:
* `"inplace"` (default) - Inplace Upgrade procedure (with Upgrade initContainer)
* `"replace"` - Replaces server instead of upgrading. Takes an effect only on DBServer
* `"manual"` - Waits for the manual upgrade. Requires replacement or the annotation on the member

***

Expand Down Expand Up @@ -5208,6 +5260,18 @@ LabelsMode Define labels mode which should be use while overriding labels

***

### .spec.single.manualUpgradeMode

Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.49/pkg/apis/deployment/v1/server_group_spec.go#L224)</sup>

UpgradeMode Defines the manually triggered upgrade mode for the Member

Possible Values:
* `"inplace"` (default) - Inplace Upgrade procedure (with Upgrade initContainer)
* `"replace"` - Replaces server instead of upgrading. Takes an effect only on DBServer

***

### .spec.single.maxCount

Type: `integer` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.49/pkg/apis/deployment/v1/server_group_spec.go#L50)</sup>
Expand Down Expand Up @@ -5589,7 +5653,7 @@ Links:

### .spec.single.restartPolicy

Type: `core.RestartPolicy` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.49/pkg/apis/deployment/v1/server_group_spec.go#L224)</sup>
Type: `core.RestartPolicy` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.49/pkg/apis/deployment/v1/server_group_spec.go#L231)</sup>

RestartPolicy for all pods within the group.

Expand Down Expand Up @@ -5830,13 +5894,14 @@ Links:

### .spec.single.upgradeMode

Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.49/pkg/apis/deployment/v1/server_group_spec.go#L217)</sup>
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.49/pkg/apis/deployment/v1/server_group_spec.go#L218)</sup>

UpgradeMode Defines the upgrade mode for the Member

Possible Values:
* `"inplace"` (default) - Inplace Upgrade procedure (with Upgrade initContainer)
* `"replace"` - Replaces server instead of upgrading. Takes an effect only on DBServer
* `"manual"` - Waits for the manual upgrade. Requires replacement or the annotation on the member

***

Expand Down Expand Up @@ -6387,6 +6452,18 @@ LabelsMode Define labels mode which should be use while overriding labels

***

### .spec.syncmasters.manualUpgradeMode

Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.49/pkg/apis/deployment/v1/server_group_spec.go#L224)</sup>

UpgradeMode Defines the manually triggered upgrade mode for the Member

Possible Values:
* `"inplace"` (default) - Inplace Upgrade procedure (with Upgrade initContainer)
* `"replace"` - Replaces server instead of upgrading. Takes an effect only on DBServer

***

### .spec.syncmasters.maxCount

Type: `integer` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.49/pkg/apis/deployment/v1/server_group_spec.go#L50)</sup>
Expand Down Expand Up @@ -6768,7 +6845,7 @@ Links:

### .spec.syncmasters.restartPolicy

Type: `core.RestartPolicy` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.49/pkg/apis/deployment/v1/server_group_spec.go#L224)</sup>
Type: `core.RestartPolicy` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.49/pkg/apis/deployment/v1/server_group_spec.go#L231)</sup>

RestartPolicy for all pods within the group.

Expand Down Expand Up @@ -7009,13 +7086,14 @@ Links:

### .spec.syncmasters.upgradeMode

Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.49/pkg/apis/deployment/v1/server_group_spec.go#L217)</sup>
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.49/pkg/apis/deployment/v1/server_group_spec.go#L218)</sup>

UpgradeMode Defines the upgrade mode for the Member

Possible Values:
* `"inplace"` (default) - Inplace Upgrade procedure (with Upgrade initContainer)
* `"replace"` - Replaces server instead of upgrading. Takes an effect only on DBServer
* `"manual"` - Waits for the manual upgrade. Requires replacement or the annotation on the member

***

Expand Down Expand Up @@ -7344,6 +7422,18 @@ LabelsMode Define labels mode which should be use while overriding labels

***

### .spec.syncworkers.manualUpgradeMode

Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.49/pkg/apis/deployment/v1/server_group_spec.go#L224)</sup>

UpgradeMode Defines the manually triggered upgrade mode for the Member

Possible Values:
* `"inplace"` (default) - Inplace Upgrade procedure (with Upgrade initContainer)
* `"replace"` - Replaces server instead of upgrading. Takes an effect only on DBServer

***

### .spec.syncworkers.maxCount

Type: `integer` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.49/pkg/apis/deployment/v1/server_group_spec.go#L50)</sup>
Expand Down Expand Up @@ -7725,7 +7815,7 @@ Links:

### .spec.syncworkers.restartPolicy

Type: `core.RestartPolicy` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.49/pkg/apis/deployment/v1/server_group_spec.go#L224)</sup>
Type: `core.RestartPolicy` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.49/pkg/apis/deployment/v1/server_group_spec.go#L231)</sup>

RestartPolicy for all pods within the group.

Expand Down Expand Up @@ -7966,13 +8056,14 @@ Links:

### .spec.syncworkers.upgradeMode

Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.49/pkg/apis/deployment/v1/server_group_spec.go#L217)</sup>
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.49/pkg/apis/deployment/v1/server_group_spec.go#L218)</sup>

UpgradeMode Defines the upgrade mode for the Member

Possible Values:
* `"inplace"` (default) - Inplace Upgrade procedure (with Upgrade initContainer)
* `"replace"` - Replaces server instead of upgrading. Takes an effect only on DBServer
* `"manual"` - Waits for the manual upgrade. Requires replacement or the annotation on the member

***

Expand Down
17 changes: 9 additions & 8 deletions pkg/apis/deployment/annotations.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// DISCLAIMER
//
// Copyright 2016-2023 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.
Expand All @@ -21,11 +21,12 @@
package deployment

const (
ArangoDeploymentAnnotationPrefix = "deployment.arangodb.com"
ArangoDeploymentPodMaintenanceAnnotation = ArangoDeploymentAnnotationPrefix + "/maintenance"
ArangoDeploymentPodChangeArchAnnotation = ArangoDeploymentAnnotationPrefix + "/arch"
ArangoDeploymentPodRotateAnnotation = ArangoDeploymentAnnotationPrefix + "/rotate"
ArangoDeploymentPodReplaceAnnotation = ArangoDeploymentAnnotationPrefix + "/replace"
ArangoDeploymentPodDeleteNow = ArangoDeploymentAnnotationPrefix + "/delete_now"
ArangoDeploymentPlanCleanAnnotation = "plan." + ArangoDeploymentAnnotationPrefix + "/clean"
ArangoDeploymentAnnotationPrefix = "deployment.arangodb.com"
ArangoDeploymentPodMaintenanceAnnotation = ArangoDeploymentAnnotationPrefix + "/maintenance"
ArangoDeploymentPodChangeArchAnnotation = ArangoDeploymentAnnotationPrefix + "/arch"
ArangoDeploymentPodRotateAnnotation = ArangoDeploymentAnnotationPrefix + "/rotate"
ArangoDeploymentPodReplaceAnnotation = ArangoDeploymentAnnotationPrefix + "/replace"
ArangoDeploymentPodAllowUpgradeAnnotation = "upgrade." + ArangoDeploymentAnnotationPrefix + "/allow"
ArangoDeploymentPodDeleteNow = ArangoDeploymentAnnotationPrefix + "/delete_now"
ArangoDeploymentPlanCleanAnnotation = "plan." + ArangoDeploymentAnnotationPrefix + "/clean"
)
2 changes: 2 additions & 0 deletions pkg/apis/deployment/v1/conditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ const (
ConditionTypeTerminated ConditionType = "Terminated"
// ConditionTypeAutoUpgrade indicates that the member has to be started with `--database.auto-upgrade` once.
ConditionTypeAutoUpgrade ConditionType = "AutoUpgrade"
// ConditionTypeUpgradeAllowed indicates that the member upgrade is allowed in the manual procedure.
ConditionTypeUpgradeAllowed ConditionType = "UpgradeAllowed"

// ConditionTypeCleanedOut indicates that the member (dbserver) has been cleaned out.
// Always check in combination with ConditionTypeTerminated.
Expand Down
11 changes: 10 additions & 1 deletion pkg/apis/deployment/v1/server_group_spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,16 @@ type ServerGroupSpec struct {
// UpgradeMode Defines the upgrade mode for the Member
// +doc/enum: inplace|Inplace Upgrade procedure (with Upgrade initContainer)
// +doc/enum: replace|Replaces server instead of upgrading. Takes an effect only on DBServer
// +doc/enum: manual| Waits for the manual upgrade. Requires replacement or the annotation on the member
// +doc/default: inplace
UpgradeMode *ServerGroupUpgradeMode `json:"upgradeMode,omitempty"`

// UpgradeMode Defines the manually triggered upgrade mode for the Member
// +doc/enum: inplace|Inplace Upgrade procedure (with Upgrade initContainer)
// +doc/enum: replace|Replaces server instead of upgrading. Takes an effect only on DBServer
// +doc/default: inplace
ManualUpgradeMode *ServerGroupUpgradeMode `json:"manualUpgradeMode,omitempty"`

// RestartPolicy for all pods within the group.
// +doc/type: core.RestartPolicy
// +doc/enum: Always|Means that containers within the pod are always restarted.
Expand Down Expand Up @@ -479,7 +486,9 @@ func (s *ServerGroupSpec) validate() error {
shared.PrefixResourceError("volumes", s.Volumes.Validate()),
shared.PrefixResourceError("volumeMounts", s.VolumeMounts.Validate()),
shared.PrefixResourceError("initContainers", s.InitContainers.Validate()),
shared.PrefixResourceError("IndexMethod", s.IndexMethod.Validate()),
shared.PrefixResourceError("indexMethod", s.IndexMethod.Validate()),
shared.PrefixResourceError("upgradeMode", s.UpgradeMode.Validate()),
shared.PrefixResourceError("manualUpgradeMode", s.ManualUpgradeMode.Validate()),
s.validateVolumes(),
)
}
Expand Down
Loading