Skip to content

Commit f7e5453

Browse files
authored
[Feature] Add ephemeral volumes for apps (#777)
1 parent 2eb4ccc commit f7e5453

15 files changed

+437
-29
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
- Update 'github.com/arangodb/arangosync-client' dependency to v0.7.0
55
- Add HighPriorityPlan to ArangoDeployment Status
66
- Add Pending Member phase
7+
- Add Ephemeral Volumes for apps feature
78

89
## [1.2.1](https://github.com/arangodb/kube-arangodb/tree/1.2.1) (2021-07-28)
910
- Fix ArangoMember race with multiple ArangoDeployments within single namespace

README.md

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -67,33 +67,35 @@ covers individual newer features separately.
6767

6868
Feature-wise production readiness table:
6969

70-
| Feature | Operator Version | ArangoDB Version | ArangoDB Edition | State | Enabled | Flag | Remarks |
71-
|-----------------------------------------|------------------|------------------|-----------------------|------------|---------|--------------------------------------------|--------------------------------------------------------------------------|
72-
| Pod Disruption Budgets | 0.3.10 | Any | Community, Enterprise | Alpha | True | N/A | N/A |
73-
| Pod Disruption Budgets | 0.3.11 | Any | Community, Enterprise | Production | True | N/A | N/A |
74-
| Volume Resizing | 0.3.10 | Any | Community, Enterprise | Alpha | True | N/A | N/A |
75-
| Volume Resizing | 0.3.11 | Any | Community, Enterprise | Production | True | N/A | N/A |
76-
| Disabling of liveness probes | 0.3.10 | Any | Community, Enterprise | Alpha | True | N/A | N/A |
77-
| Disabling of liveness probes | 0.3.11 | Any | Community, Enterprise | Production | True | N/A | N/A |
78-
| Volume Claim Templates | 0.3.11 | Any | Community, Enterprise | Alpha | True | N/A | N/A |
79-
| Volume Claim Templates | 1.0.0 | Any | Community, Enterprise | Production | True | N/A | N/A |
80-
| Prometheus Metrics Exporter | 0.3.11 | Any | Community, Enterprise | Alpha | True | N/A | Prometheus required |
81-
| Prometheus Metrics Exporter | 1.0.0 | Any | Community, Enterprise | Production | True | N/A | Prometheus required |
82-
| Sidecar Containers | 0.3.11 | Any | Community, Enterprise | Alpha | True | N/A | N/A |
83-
| Sidecar Containers | 1.0.0 | Any | Community, Enterprise | Production | True | N/A | N/A |
84-
| 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 |
85-
| TLS SNI Support | 1.0.3 | >= 3.7.0 | Enterprise | Production | True | --deployment.feature.tls-sni | N/A |
86-
| TLS Runtime Rotation Support | 1.0.4 | > 3.7.0 | Enterprise | Alpha | False | --deployment.feature.tls-rotation | N/A |
87-
| TLS Runtime Rotation Support | 1.1.0 | > 3.7.0 | Enterprise | Production | True | --deployment.feature.tls-rotation | N/A |
88-
| JWT Rotation Support | 1.0.4 | > 3.7.0 | Enterprise | Alpha | False | --deployment.feature.jwt-rotation | N/A |
89-
| JWT Rotation Support | 1.1.0 | > 3.7.0 | Enterprise | Production | True | --deployment.feature.jwt-rotation | N/A |
90-
| Encryption Key Rotation Support | 1.0.4 | > 3.7.0 | Enterprise | Alpha | False | --deployment.feature.encryption-rotation | N/A |
91-
| Encryption Key Rotation Support | 1.1.0 | > 3.7.0 | Enterprise | Production | True | --deployment.feature.encryption-rotation | N/A |
92-
| Version Check | 1.1.4 | >= 3.5.0 | Community, Enterprise | Alpha | False | --deployment.feature.upgrade-version-check | N/A |
93-
| Operator Maintenance Management Support | 1.0.7 | >= 3.5.0 | Community, Enterprise | Alpha | False | --deployment.feature.maintenance | N/A |
94-
| Operator Maintenance Management Support | 1.2.0 | >= 3.5.0 | Community, Enterprise | Production | True | --deployment.feature.maintenance | N/A |
95-
| Operator Internal Metrics Exporter | 1.1.9 | >= 3.6.0 | Community, Enterprise | Alpha | False | --deployment.feature.metrics-exporter | N/A |
96-
| Operator Internal Metrics Exporter | 1.2.0 | >= 3.6.0 | Community, Enterprise | Production | True | --deployment.feature.metrics-exporter | N/A |
70+
| Feature | Operator Version | ArangoDB Version | ArangoDB Edition | State | Enabled | Flag | Remarks |
71+
|-----------------------------------------|------------------|------------------|-----------------------|--------------|---------|--------------------------------------------|--------------------------------------------------------------------------|
72+
| Pod Disruption Budgets | 0.3.10 | Any | Community, Enterprise | Alpha | True | N/A | N/A |
73+
| Pod Disruption Budgets | 0.3.11 | Any | Community, Enterprise | Production | True | N/A | N/A |
74+
| Volume Resizing | 0.3.10 | Any | Community, Enterprise | Alpha | True | N/A | N/A |
75+
| Volume Resizing | 0.3.11 | Any | Community, Enterprise | Production | True | N/A | N/A |
76+
| Disabling of liveness probes | 0.3.10 | Any | Community, Enterprise | Alpha | True | N/A | N/A |
77+
| Disabling of liveness probes | 0.3.11 | Any | Community, Enterprise | Production | True | N/A | N/A |
78+
| Volume Claim Templates | 0.3.11 | Any | Community, Enterprise | Alpha | True | N/A | N/A |
79+
| Volume Claim Templates | 1.0.0 | Any | Community, Enterprise | Production | True | N/A | N/A |
80+
| Prometheus Metrics Exporter | 0.3.11 | Any | Community, Enterprise | Alpha | True | N/A | Prometheus required |
81+
| Prometheus Metrics Exporter | 1.0.0 | Any | Community, Enterprise | Production | True | N/A | Prometheus required |
82+
| Sidecar Containers | 0.3.11 | Any | Community, Enterprise | Alpha | True | N/A | N/A |
83+
| Sidecar Containers | 1.0.0 | Any | Community, Enterprise | Production | True | N/A | N/A |
84+
| 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 |
85+
| TLS SNI Support | 1.0.3 | >= 3.7.0 | Enterprise | Production | True | --deployment.feature.tls-sni | N/A |
86+
| TLS Runtime Rotation Support | 1.0.4 | > 3.7.0 | Enterprise | Alpha | False | --deployment.feature.tls-rotation | N/A |
87+
| TLS Runtime Rotation Support | 1.1.0 | > 3.7.0 | Enterprise | Production | True | --deployment.feature.tls-rotation | N/A |
88+
| JWT Rotation Support | 1.0.4 | > 3.7.0 | Enterprise | Alpha | False | --deployment.feature.jwt-rotation | N/A |
89+
| JWT Rotation Support | 1.1.0 | > 3.7.0 | Enterprise | Production | True | --deployment.feature.jwt-rotation | N/A |
90+
| Encryption Key Rotation Support | 1.0.4 | > 3.7.0 | Enterprise | Alpha | False | --deployment.feature.encryption-rotation | N/A |
91+
| Encryption Key Rotation Support | 1.1.0 | > 3.7.0 | Enterprise | Production | True | --deployment.feature.encryption-rotation | N/A |
92+
| Encryption Key Rotation Support | 1.2.0 | > 3.7.0 | Enterprise | NotSupported | False | --deployment.feature.encryption-rotation | N/A |
93+
| Version Check | 1.1.4 | >= 3.6.0 | Community, Enterprise | Alpha | False | --deployment.feature.upgrade-version-check | N/A |
94+
| Operator Maintenance Management Support | 1.0.7 | >= 3.6.0 | Community, Enterprise | Alpha | False | --deployment.feature.maintenance | N/A |
95+
| Operator Maintenance Management Support | 1.2.0 | >= 3.6.0 | Community, Enterprise | Production | True | --deployment.feature.maintenance | N/A |
96+
| Operator Internal Metrics Exporter | 1.1.9 | >= 3.6.0 | Community, Enterprise | Alpha | False | --deployment.feature.metrics-exporter | N/A |
97+
| Operator Internal Metrics Exporter | 1.2.0 | >= 3.6.0 | Community, Enterprise | Production | True | --deployment.feature.metrics-exporter | N/A |
98+
| Operator Ephemeral Volumes | 1.2.2 | >= 3.7.0 | Community, Enterprise | Alpha | False | --deployment.feature.ephemeral-volumes | N/A |
9799

98100
## Release notes for 0.3.16
99101

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
//
2+
// DISCLAIMER
3+
//
4+
// Copyright 2021 ArangoDB GmbH, Cologne, Germany
5+
//
6+
// Licensed under the Apache License, Version 2.0 (the "License");
7+
// you may not use this file except in compliance with the License.
8+
// You may obtain a copy of the License at
9+
//
10+
// http://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing, software
13+
// distributed under the License is distributed on an "AS IS" BASIS,
14+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
// See the License for the specific language governing permissions and
16+
// limitations under the License.
17+
//
18+
// Copyright holder is ArangoDB GmbH, Cologne, Germany
19+
//
20+
// Author Adam Janikowski
21+
//
22+
23+
package v1
24+
25+
import "k8s.io/apimachinery/pkg/api/resource"
26+
27+
// EphemeralVolumes keeps info about ephemeral volumes. Used only with `ephemeral-volumes` feature.
28+
type EphemeralVolumes struct {
29+
// Apps define apps ephemeral volume in case if `ephemeral-volumes` feature is enabled.
30+
Apps *EphemeralVolume `json:"apps,omitempty"`
31+
// Temp define temp ephemeral volume in case if `ephemeral-volumes` feature is enabled.
32+
Temp *EphemeralVolume `json:"temp,omitempty"`
33+
}
34+
35+
// GetAppsSize returns apps volume size with default value of nil.
36+
func (e *EphemeralVolumes) GetAppsSize() *resource.Quantity {
37+
return e.getAppsSize(nil)
38+
}
39+
40+
func (e *EphemeralVolumes) getAppsSize(d *resource.Quantity) *resource.Quantity {
41+
if e == nil {
42+
return d
43+
}
44+
45+
return e.Apps.GetSize(d)
46+
}
47+
48+
// GetTempSize returns temp volume size with default value of nil.
49+
func (e *EphemeralVolumes) GetTempSize() *resource.Quantity {
50+
return e.getTempSize(nil)
51+
}
52+
53+
func (e *EphemeralVolumes) getTempSize(d *resource.Quantity) *resource.Quantity {
54+
if e == nil {
55+
return d
56+
}
57+
58+
return e.Temp.GetSize(d)
59+
}
60+
61+
// EphemeralVolume keeps information about ephemeral volumes.
62+
type EphemeralVolume struct {
63+
Size *resource.Quantity `json:"size"`
64+
}
65+
66+
// GetSize returns size. If not defined, default is returned.
67+
func (e *EphemeralVolume) GetSize(d *resource.Quantity) *resource.Quantity {
68+
if e == nil || e.Size == nil {
69+
return d
70+
}
71+
72+
return e.Size
73+
}

pkg/apis/deployment/v1/server_group_spec.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
// Copyright holder is ArangoDB GmbH, Cologne, Germany
1919
//
2020
// Author Ewout Prangsma
21+
// Author Adam Janikowski
2122
//
2223

2324
package v1
@@ -131,6 +132,8 @@ type ServerGroupSpec struct {
131132
Volumes ServerGroupSpecVolumes `json:"volumes,omitempty"`
132133
// VolumeMounts define list of volume mounts mounted into server container
133134
VolumeMounts ServerGroupSpecVolumeMounts `json:"volumeMounts,omitempty"`
135+
// EphemeralVolumes keeps information about ephemeral volumes.
136+
EphemeralVolumes *EphemeralVolumes `json:"ephemeralVolumes,omitempty"`
134137
// ExtendedRotationCheck extend checks for rotation
135138
ExtendedRotationCheck *bool `json:"extendedRotationCheck,omitempty"`
136139
// InitContainers Init containers specification

pkg/apis/deployment/v1/server_group_volume.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ var (
4242
k8sutil.RocksdbEncryptionVolumeName,
4343
k8sutil.ExporterJWTVolumeName,
4444
k8sutil.ClusterJWTSecretVolumeName,
45-
"lifecycle",
45+
k8sutil.LifecycleVolumeName,
46+
k8sutil.FoxxAppEphemeralVolumeName,
47+
k8sutil.TMPEphemeralVolumeName,
4648
}
4749
)
4850

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

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

0 commit comments

Comments
 (0)