Skip to content

Commit 8761cf6

Browse files
authored
[Feature] [License] Master Management (#1975)
1 parent 299caee commit 8761cf6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1417
-457
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- (Feature) (Platform) EventsV1 Integration
1010
- (Feature) (Platform) Allows to opt out in the Inventory Telemetry
1111
- (Feature) Simplify Operator ID Process
12+
- (Feature) (License) Activation API Integration
1213

1314
## [1.3.1](https://github.com/arangodb/kube-arangodb/tree/1.3.1) (2025-10-07)
1415
- (Documentation) Add ArangoPlatformStorage Docs & Examples

docs/api/ArangoDeployment.V1.md

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4791,16 +4791,69 @@ Possible Values:
47914791

47924792
***
47934793

4794+
### .spec.license.expirationGracePeriod
4795+
4796+
Type: `integer` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.3.1/pkg/apis/deployment/v1/license_spec.go#L68)</sup>
4797+
4798+
ExpirationGracePeriod defines the expiration grace period for the license
4799+
4800+
Default Value: `72h`
4801+
4802+
***
4803+
4804+
### .spec.license.inventory
4805+
4806+
Type: `boolean` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.3.1/pkg/apis/deployment/v1/license_spec.go#L76)</sup>
4807+
4808+
Inventory defines if inventory is collected
4809+
4810+
Default Value: `true`
4811+
4812+
***
4813+
4814+
### .spec.license.mode
4815+
4816+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.3.1/pkg/apis/deployment/v1/license_spec.go#L60)</sup>
4817+
4818+
Mode Defines the mode of license
4819+
4820+
Possible Values:
4821+
* `"discover"` (default) - Discovers the LicenseMode based on the keys
4822+
* `"key"` - Use License Key mechanism
4823+
* `"master"` - Use License Master Key mechanism
4824+
4825+
***
4826+
47944827
### .spec.license.secretName
47954828

4796-
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.3.1/pkg/apis/deployment/v1/license_spec.go#L33)</sup>
4829+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.3.1/pkg/apis/deployment/v1/license_spec.go#L53)</sup>
47974830

47984831
SecretName setting specifies the name of a kubernetes `Secret` that contains
4799-
the license key token used for enterprise images. This value is not used for
4832+
the license key token or master key used for enterprise images. This value is not used for
48004833
the Community Edition.
48014834

48024835
***
48034836

4837+
### .spec.license.telemetry
4838+
4839+
Type: `boolean` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.3.1/pkg/apis/deployment/v1/license_spec.go#L72)</sup>
4840+
4841+
Telemetry defines if telemetry is collected
4842+
4843+
Default Value: `true`
4844+
4845+
***
4846+
4847+
### .spec.license.ttl
4848+
4849+
Type: `integer` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.3.1/pkg/apis/deployment/v1/license_spec.go#L64)</sup>
4850+
4851+
TTL Sets the requested License TTL
4852+
4853+
Default Value: `336h`
4854+
4855+
***
4856+
48044857
### .spec.lifecycle.resources
48054858

48064859
Type: `core.ResourceRequirements` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.3.1/pkg/apis/deployment/v1/lifecycle_spec.go#L31)</sup>

docs/generated/actions.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ nav_order: 11
4747
| JWTSetActive | no | 10m0s | no | Enterprise Only | Change active JWT key on the cluster |
4848
| JWTStatusUpdate | no | 10m0s | no | Enterprise Only | Update status of JWT propagation |
4949
| KillMemberPod | no | 10m0s | no | Community & Enterprise | Execute Delete on Pod (put pod in Terminating state) |
50+
| LicenseClean | no | 10m0s | no | Community & Enterprise | Removes the License reference from the status |
51+
| LicenseGenerate | no | 10m0s | no | Community & Enterprise | Generates License using ArangoDB LicenseManager Endpoint |
5052
| LicenseSet | no | 10m0s | no | Community & Enterprise | Update Cluster license (3.9+) |
5153
| MarkToRemoveMember | no | 10m0s | no | Community & Enterprise | Marks member to be removed. Used when member Pod is annotated with replace annotation |
5254
| MemberPhaseUpdate | no | 10m0s | no | Community & Enterprise | Change member phase |
@@ -78,6 +80,7 @@ nav_order: 11
7880
| RuntimeContainerArgsLogLevelUpdate | no | 10m0s | no | Community & Enterprise | Change ArangoDB Member log levels in runtime |
7981
| RuntimeContainerImageUpdate | no | 10m0s | no | Community & Enterprise | Update Container Image in runtime |
8082
| RuntimeContainerSyncTolerations | no | 10m0s | no | Community & Enterprise | Update Pod Tolerations in runtime |
83+
| SetAnnotation | yes | 10m0s | no | Community & Enterprise | Set ArangoDeployment annotation |
8184
| ~~SetCondition~~ | no | 10m0s | no | Community & Enterprise | Set deployment condition |
8285
| SetConditionV2 | yes | 10m0s | no | Community & Enterprise | Set deployment condition |
8386
| SetCurrentImage | no | 6h0m0s | no | Community & Enterprise | Update deployment current image after image discovery |
@@ -146,6 +149,8 @@ spec:
146149
JWTSetActive: 10m0s
147150
JWTStatusUpdate: 10m0s
148151
KillMemberPod: 10m0s
152+
LicenseClean: 10m0s
153+
LicenseGenerate: 10m0s
149154
LicenseSet: 10m0s
150155
MarkToRemoveMember: 10m0s
151156
MemberPhaseUpdate: 10m0s
@@ -177,6 +182,7 @@ spec:
177182
RuntimeContainerArgsLogLevelUpdate: 10m0s
178183
RuntimeContainerImageUpdate: 10m0s
179184
RuntimeContainerSyncTolerations: 10m0s
185+
SetAnnotation: 10m0s
180186
SetCondition: 10m0s
181187
SetConditionV2: 10m0s
182188
SetCurrentImage: 6h0m0s

internal/actions.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,11 @@ actions:
232232
scopes:
233233
- High
234234
isInternal: true
235+
SetAnnotation:
236+
description: Set ArangoDeployment annotation
237+
scopes:
238+
- High
239+
isInternal: true
235240
MemberRIDUpdate:
236241
description: Update Run ID of member
237242
scopes:
@@ -247,6 +252,10 @@ actions:
247252
- High
248253
LicenseSet:
249254
description: Update Cluster license (3.9+)
255+
LicenseGenerate:
256+
description: Generates License using ArangoDB LicenseManager Endpoint
257+
LicenseClean:
258+
description: Removes the License reference from the status
250259
RuntimeContainerImageUpdate:
251260
description: Update Container Image in runtime
252261
RuntimeContainerSyncTolerations:

pkg/apis/deployment/v1/actions.generated.go

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

pkg/apis/deployment/v1/deployment_status.go

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DISCLAIMER
33
//
4-
// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany
4+
// Copyright 2016-2025 ArangoDB GmbH, Cologne, Germany
55
//
66
// Licensed under the Apache License, Version 2.0 (the "License");
77
// you may not use this file except in compliance with the License.
@@ -53,6 +53,7 @@ type DeploymentStatus struct {
5353

5454
// Images holds a list of ArangoDB images with their ID and ArangoDB version.
5555
Images ImageInfoList `json:"arangodb-images,omitempty"`
56+
5657
// Image that is currently being used when new pods are created
5758
CurrentImage *ImageInfo `json:"current-image,omitempty"`
5859

@@ -97,6 +98,8 @@ type DeploymentStatus struct {
9798

9899
Timezone *string `json:"timezone,omitempty"`
99100

101+
License *DeploymentStatusLicense `json:"license,omitempty"`
102+
100103
Single *ServerGroupStatus `json:"single,omitempty"`
101104
Agents *ServerGroupStatus `json:"agents,omitempty"`
102105
DBServers *ServerGroupStatus `json:"dbservers,omitempty"`
@@ -135,7 +138,8 @@ func (ds *DeploymentStatus) Equal(other DeploymentStatus) bool {
135138
ds.Coordinators.Equal(other.Coordinators) &&
136139
ds.SyncMasters.Equal(other.SyncMasters) &&
137140
ds.SyncWorkers.Equal(other.SyncWorkers) &&
138-
strings.CompareStringPointers(ds.Timezone, other.Timezone)
141+
strings.CompareStringPointers(ds.Timezone, other.Timezone) &&
142+
ds.License.Equal(other.License)
139143
}
140144

141145
// IsForceReload returns true if ForceStatusReload is set to true
@@ -147,6 +151,14 @@ func (ds *DeploymentStatus) IsPlanEmpty() bool {
147151
return ds.Plan.IsEmpty() && ds.HighPriorityPlan.IsEmpty()
148152
}
149153

154+
func (ds *DeploymentStatus) IsEnterprise() bool {
155+
if ds == nil {
156+
return false
157+
}
158+
159+
return ds.CurrentImage.IsEnterprise()
160+
}
161+
150162
func (ds *DeploymentStatus) NonInternalActions() int {
151163
return ds.Plan.NonInternalActions() + ds.HighPriorityPlan.NonInternalActions()
152164
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
//
2+
// DISCLAIMER
3+
//
4+
// Copyright 2025 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+
21+
package v1
22+
23+
import meta "k8s.io/apimachinery/pkg/apis/meta/v1"
24+
25+
// DeploymentStatusLicense contains the status part of a Cluster resource.
26+
type DeploymentStatusLicense struct {
27+
// ID Defines the License ID
28+
ID string `json:"id,omitempty"`
29+
30+
// Hash Defines the License Hash
31+
Hash string `json:"hash,omitempty"`
32+
33+
// Expires Defines the expiration time of the License
34+
Expires meta.Time `json:"expires,omitempty"`
35+
36+
// Regenerate Defines the time when license will be regenerated
37+
Regenerate meta.Time `json:"regenerate,omitempty"`
38+
39+
// Mode defines the license mode
40+
Mode LicenseMode `json:"mode,omitempty"`
41+
}
42+
43+
// Equal checks for equality
44+
func (ds *DeploymentStatusLicense) Equal(other *DeploymentStatusLicense) bool {
45+
if ds == nil && other == nil {
46+
return true
47+
}
48+
49+
if ds == nil || other == nil {
50+
return false
51+
}
52+
53+
return ds.ID == other.ID && ds.Hash == other.Hash
54+
}

pkg/apis/deployment/v1/image_info.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DISCLAIMER
33
//
4-
// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany
4+
// Copyright 2016-2025 ArangoDB GmbH, Cologne, Germany
55
//
66
// Licensed under the Apache License, Version 2.0 (the "License");
77
// you may not use this file except in compliance with the License.
@@ -48,6 +48,15 @@ func (i *ImageInfo) String() string {
4848
return fmt.Sprintf("ArangoDB %s %s (%s)", e, string(i.ArangoDBVersion), i.Image)
4949
}
5050

51+
// IsEnterprise returns true if image is enterprise
52+
func (i *ImageInfo) IsEnterprise() bool {
53+
if i == nil {
54+
return false
55+
}
56+
57+
return i.Enterprise
58+
}
59+
5160
// ImageInfoList is a list of image infos
5261
type ImageInfoList []ImageInfo
5362

0 commit comments

Comments
 (0)