Skip to content

Commit cb1f17a

Browse files
authored
[Feature] Upgrade improvements (#686)
1 parent 147ccdd commit cb1f17a

26 files changed

+400
-66
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## [master](https://github.com/arangodb/kube-arangodb/tree/master) (N/A)
44
- Add support for spec.ClusterDomain to be able to use FQDN in ArangoDB cluster communication
5+
- Add Version Check feature with extended Upgrade checks
6+
- Fix Upgrade failures recovery
57

68
## [1.1.3](https://github.com/arangodb/kube-arangodb/tree/1.1.3) (2020-12-16)
79
- Add v2alpha1 API for ArangoDeployment and ArangoDeploymentReplication

README.md

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -54,28 +54,30 @@ covers individual newer features separately.
5454

5555
Feature-wise production readiness table:
5656

57-
| Feature | Operator Version | ArangoDB Version | ArangoDB Edition | State | Enabled | Flag | Remarks |
58-
|-----------------------------------------|------------------|------------------|-----------------------|------------|---------|------------------------------------------|--------------------------------------------------------------------------|
59-
| Pod Disruption Budgets | 0.3.10 | Any | Community, Enterprise | Alpha | True | N/A | N/A |
60-
| Pod Disruption Budgets | 0.3.11 | Any | Community, Enterprise | Production | True | N/A | N/A |
61-
| Volume Resizing | 0.3.10 | Any | Community, Enterprise | Alpha | True | N/A | N/A |
62-
| Volume Resizing | 0.3.11 | Any | Community, Enterprise | Production | True | N/A | N/A |
63-
| Disabling of liveness probes | 0.3.10 | Any | Community, Enterprise | Alpha | True | N/A | N/A |
64-
| Disabling of liveness probes | 0.3.11 | Any | Community, Enterprise | Production | True | N/A | N/A |
65-
| Volume Claim Templates | 0.3.11 | Any | Community, Enterprise | Alpha | True | N/A | N/A |
66-
| Volume Claim Templates | 1.0.0 | Any | Community, Enterprise | Production | True | N/A | N/A |
67-
| Prometheus Metrics Exporter | 0.3.11 | Any | Community, Enterprise | Alpha | True | N/A | Prometheus required |
68-
| Prometheus Metrics Exporter | 1.0.0 | Any | Community, Enterprise | Production | True | N/A | Prometheus required |
69-
| Sidecar Containers | 0.3.11 | Any | Community, Enterprise | Alpha | True | N/A | N/A |
70-
| Sidecar Containers | 1.0.0 | Any | Community, Enterprise | Production | True | N/A | N/A |
71-
| Operator Single Mode | 1.0.4 | Any | Community, Enterprise | Production | False | --mode.single | Only 1 instance of Operator allowed in namespace when feature is enabled |
72-
| TLS SNI Support | 1.0.3 | >= 3.7.0 | Enterprise | Production | True | --deployment.feature.tls-sni | N/A |
73-
| TLS Runtime Rotation Support | 1.0.4 | > 3.7.0 | Enterprise | Alpha | False | --deployment.feature.tls-rotation | N/A |
74-
| TLS Runtime Rotation Support | 1.1.0 | > 3.7.0 | Enterprise | Production | True | --deployment.feature.tls-rotation | N/A |
75-
| JWT Rotation Support | 1.0.4 | > 3.7.0 | Enterprise | Alpha | False | --deployment.feature.jwt-rotation | N/A |
76-
| JWT Rotation Support | 1.1.0 | > 3.7.0 | Enterprise | Production | True | --deployment.feature.jwt-rotation | N/A |
77-
| Encryption Key Rotation Support | 1.0.4 | > 3.7.0 | Enterprise | Alpha | False | --deployment.feature.encryption-rotation | N/A |
78-
| Operator Maintenance Management Support | 1.0.7 | >= 3.5.0 | Community, Enterprise | Alpha | False | --deployment.feature.maintenance | N/A |
57+
| Feature | Operator Version | ArangoDB Version | ArangoDB Edition | State | Enabled | Flag | Remarks |
58+
|-----------------------------------------|------------------|------------------|-----------------------|------------|---------|--------------------------------------------|--------------------------------------------------------------------------|
59+
| Pod Disruption Budgets | 0.3.10 | Any | Community, Enterprise | Alpha | True | N/A | N/A |
60+
| Pod Disruption Budgets | 0.3.11 | Any | Community, Enterprise | Production | True | N/A | N/A |
61+
| Volume Resizing | 0.3.10 | Any | Community, Enterprise | Alpha | True | N/A | N/A |
62+
| Volume Resizing | 0.3.11 | Any | Community, Enterprise | Production | True | N/A | N/A |
63+
| Disabling of liveness probes | 0.3.10 | Any | Community, Enterprise | Alpha | True | N/A | N/A |
64+
| Disabling of liveness probes | 0.3.11 | Any | Community, Enterprise | Production | True | N/A | N/A |
65+
| Volume Claim Templates | 0.3.11 | Any | Community, Enterprise | Alpha | True | N/A | N/A |
66+
| Volume Claim Templates | 1.0.0 | Any | Community, Enterprise | Production | True | N/A | N/A |
67+
| Prometheus Metrics Exporter | 0.3.11 | Any | Community, Enterprise | Alpha | True | N/A | Prometheus required |
68+
| Prometheus Metrics Exporter | 1.0.0 | Any | Community, Enterprise | Production | True | N/A | Prometheus required |
69+
| Sidecar Containers | 0.3.11 | Any | Community, Enterprise | Alpha | True | N/A | N/A |
70+
| Sidecar Containers | 1.0.0 | Any | Community, Enterprise | Production | True | N/A | N/A |
71+
| Operator Single Mode | 1.0.4 | Any | Community, Enterprise | Production | False | --mode.single | Only 1 instance of Operator allowed in namespace when feature is enabled |
72+
| TLS SNI Support | 1.0.3 | >= 3.7.0 | Enterprise | Production | True | --deployment.feature.tls-sni | N/A |
73+
| TLS Runtime Rotation Support | 1.0.4 | > 3.7.0 | Enterprise | Alpha | False | --deployment.feature.tls-rotation | N/A |
74+
| TLS Runtime Rotation Support | 1.1.0 | > 3.7.0 | Enterprise | Production | True | --deployment.feature.tls-rotation | N/A |
75+
| JWT Rotation Support | 1.0.4 | > 3.7.0 | Enterprise | Alpha | False | --deployment.feature.jwt-rotation | N/A |
76+
| JWT Rotation Support | 1.1.0 | > 3.7.0 | Enterprise | Production | True | --deployment.feature.jwt-rotation | N/A |
77+
| Encryption Key Rotation Support | 1.0.4 | > 3.7.0 | Enterprise | Alpha | False | --deployment.feature.encryption-rotation | N/A |
78+
| Encryption Key Rotation Support | 1.1.0 | > 3.7.0 | Enterprise | Production | True | --deployment.feature.encryption-rotation | N/A |
79+
| Version Check | 1.1.4 | >= 3.5.0 | Community, Enterprise | Alpha | False | --deployment.feature.upgrade-version-check | N/A |
80+
| Operator Maintenance Management Support | 1.0.7 | >= 3.5.0 | Community, Enterprise | Alpha | False | --deployment.feature.maintenance | N/A |
7981

8082
## Release notes for 0.3.16
8183

pkg/apis/deployment/v1/conditions.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ const (
6363
ConditionTypeUpToDate ConditionType = "UpToDate"
6464
// ConditionTypeMarkedToRemove indicates that the member is marked to be removed.
6565
ConditionTypeMarkedToRemove ConditionType = "MarkedToRemove"
66+
// ConditionTypeUpgradeFailed indicates that mem
67+
ConditionTypeUpgradeFailed ConditionType = "UpgradeFailed"
6668
)
6769

6870
// Condition represents one current condition of a deployment or deployment member.

pkg/apis/deployment/v1/image_info.go

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@
2222

2323
package v1
2424

25-
import driver "github.com/arangodb/go-driver"
25+
import (
26+
"fmt"
27+
28+
driver "github.com/arangodb/go-driver"
29+
)
2630

2731
// ImageInfo contains an ID of an image and the ArangoDB version inside the image.
2832
type ImageInfo struct {
@@ -32,6 +36,20 @@ type ImageInfo struct {
3236
Enterprise bool `json:"enterprise,omitempty"` // If set, this is an enterprise image
3337
}
3438

39+
func (i *ImageInfo) String() string {
40+
if i == nil {
41+
return "undefined"
42+
}
43+
44+
e := "Community"
45+
46+
if i.Enterprise {
47+
e = "Enterprise"
48+
}
49+
50+
return fmt.Sprintf("ArangoDB %s %s (%s)", e, string(i.ArangoDBVersion), i.Image)
51+
}
52+
3553
// ImageInfoList is a list of image infos
3654
type ImageInfoList []ImageInfo
3755

pkg/apis/deployment/v1/member_status.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ type MemberStatus struct {
6969
ImageID string `json:"image-id,omitempty"`
7070
// Image holds image details
7171
Image *ImageInfo `json:"image,omitempty"`
72+
// OldImage holds old image defails
73+
OldImage *ImageInfo `json:"old-image,omitempty"`
7274
// Upgrade define if upgrade should be enforced during next execution
7375
Upgrade bool `json:"upgrade,omitempty"`
7476
// Endpoint definition how member should be reachable
@@ -89,6 +91,7 @@ func (s MemberStatus) Equal(other MemberStatus) bool {
8991
s.ArangoVersion == other.ArangoVersion &&
9092
s.ImageID == other.ImageID &&
9193
s.Image.Equal(other.Image) &&
94+
s.OldImage.Equal(other.OldImage) &&
9295
s.Upgrade == other.Upgrade &&
9396
util.CompareStringPointers(s.Endpoint, other.Endpoint)
9497
}

pkg/apis/deployment/v1/server_group_init_containers.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,15 @@ import (
3131
)
3232

3333
const (
34-
ServerGroupReservedInitContainerNameLifecycle = "init-lifecycle"
35-
ServerGroupReservedInitContainerNameUUID = "uuid"
36-
ServerGroupReservedInitContainerNameUpgrade = "upgrade"
34+
ServerGroupReservedInitContainerNameLifecycle = "init-lifecycle"
35+
ServerGroupReservedInitContainerNameUUID = "uuid"
36+
ServerGroupReservedInitContainerNameUpgrade = "upgrade"
37+
ServerGroupReservedInitContainerNameVersionCheck = "version-check"
3738
)
3839

3940
func IsReservedServerGroupInitContainerName(name string) bool {
4041
switch name {
41-
case ServerGroupReservedInitContainerNameLifecycle, ServerGroupReservedInitContainerNameUUID, ServerGroupReservedInitContainerNameUpgrade:
42+
case ServerGroupReservedInitContainerNameLifecycle, ServerGroupReservedInitContainerNameUUID, ServerGroupReservedInitContainerNameUpgrade, ServerGroupReservedInitContainerNameVersionCheck:
4243
return true
4344
default:
4445
return false

pkg/apis/deployment/v1/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/apis/deployment/v2alpha1/conditions.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ const (
6363
ConditionTypeUpToDate ConditionType = "UpToDate"
6464
// ConditionTypeMarkedToRemove indicates that the member is marked to be removed.
6565
ConditionTypeMarkedToRemove ConditionType = "MarkedToRemove"
66+
// ConditionTypeUpgradeFailed indicates that mem
67+
ConditionTypeUpgradeFailed ConditionType = "UpgradeFailed"
6668
)
6769

6870
// Condition represents one current condition of a deployment or deployment member.

pkg/apis/deployment/v2alpha1/image_info.go

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@
2222

2323
package v2alpha1
2424

25-
import driver "github.com/arangodb/go-driver"
25+
import (
26+
"fmt"
27+
28+
driver "github.com/arangodb/go-driver"
29+
)
2630

2731
// ImageInfo contains an ID of an image and the ArangoDB version inside the image.
2832
type ImageInfo struct {
@@ -32,6 +36,20 @@ type ImageInfo struct {
3236
Enterprise bool `json:"enterprise,omitempty"` // If set, this is an enterprise image
3337
}
3438

39+
func (i *ImageInfo) String() string {
40+
if i == nil {
41+
return "undefined"
42+
}
43+
44+
e := "Community"
45+
46+
if i.Enterprise {
47+
e = "Enterprise"
48+
}
49+
50+
return fmt.Sprintf("ArangoDB %s %s (%s)", e, string(i.ArangoDBVersion), i.Image)
51+
}
52+
3553
// ImageInfoList is a list of image infos
3654
type ImageInfoList []ImageInfo
3755

pkg/apis/deployment/v2alpha1/member_status.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ type MemberStatus struct {
6969
ImageID string `json:"image-id,omitempty"`
7070
// Image holds image details
7171
Image *ImageInfo `json:"image,omitempty"`
72+
// OldImage holds old image defails
73+
OldImage *ImageInfo `json:"old-image,omitempty"`
7274
// Upgrade define if upgrade should be enforced during next execution
7375
Upgrade bool `json:"upgrade,omitempty"`
7476
// Endpoint definition how member should be reachable
@@ -89,6 +91,7 @@ func (s MemberStatus) Equal(other MemberStatus) bool {
8991
s.ArangoVersion == other.ArangoVersion &&
9092
s.ImageID == other.ImageID &&
9193
s.Image.Equal(other.Image) &&
94+
s.OldImage.Equal(other.OldImage) &&
9295
s.Upgrade == other.Upgrade &&
9396
util.CompareStringPointers(s.Endpoint, other.Endpoint)
9497
}

0 commit comments

Comments
 (0)