Skip to content

Commit f39e053

Browse files
authored
[Feature] [ML] Allow to use PlatformStorage (#1798)
1 parent 5eef795 commit f39e053

File tree

7 files changed

+112
-5
lines changed

7 files changed

+112
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
- (Feature) (Platform) Expose Route Name via Header
4949
- (Feature) (Platform) Route Upstream Timeout
5050
- (Maintenance) Fix CRD Generation and golangci version
51+
- (Feature) (ML) Allow to use PlatformStorage
5152

5253
## [1.2.43](https://github.com/arangodb/kube-arangodb/tree/1.2.43) (2024-10-14)
5354
- (Feature) ArangoRoute CRD

docs/api/ArangoMLExtension.V1Beta1.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3188,6 +3188,18 @@ Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2
31883188

31893189
UID keeps the information about object UID
31903190

3191+
***
3192+
3193+
### .spec.storageType
3194+
3195+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.43/pkg/apis/ml/v1beta1/extension_spec.go#L52)</sup>
3196+
3197+
ArangoMLExtensionSpecStorageType defines storage used for extension
3198+
3199+
Possible Values:
3200+
* `"extension"` (default) - Uses AragoMLStorage
3201+
* `"platform"` - Uses AragoPlatformStorage
3202+
31913203
## Status
31923204

31933205
### .status.arangoDB.secret.checksum

docs/platform.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,26 @@ layout: page
33
has_children: true
44
title: ArangoDBPlatform
55
has_toc: false
6-
---
6+
---
7+
8+
# Platform
9+
10+
11+
#### Community & Enterprise Edition
12+
13+
[Full CustomResourceDefinition reference ->](./api/ArangoPlatformStorage.V1Alpha1.md)
14+
15+
This instruction covers only the steps to enable ArangoPlatform in Kubernetes cluster with already running ArangoDeployment.
16+
If you don't have one yet, consider checking [kube-arangodb installation guide](./using-the-operator.md) and [ArangoDeployment CR description](./deployment-resource-reference.md).
17+
18+
### To enable Platform on your cluster, follow next steps:
19+
20+
1) Install [CertManager](https://github.com/cert-manager/cert-manager) on your cluster.
21+
22+
2) Enable Gateway Feature. Add `--deployment.feature.gateway=true` option to the Operator arguments.
23+
24+
3) Enable Webhooks. e.g. if you are using Helm package, add `--set "webhooks.enabled=true"` option to the Helm command.
25+
26+
4) Enable Managed Certificates. e.g. if you are using Helm package, add `--set "certificate.enabled=true"` option to the Helm command.
27+
28+
5) Enable Gateways in the ArangoDeployment. Set `.spec.gateway.enabled` and `.spec.gateway.dynamic` to True

pkg/apis/ml/v1beta1/extension_spec.go

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DISCLAIMER
33
//
4-
// Copyright 2024 ArangoDB GmbH, Cologne, Germany
4+
// Copyright 2024-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.
@@ -31,7 +31,7 @@ type ArangoMLExtensionSpec struct {
3131
// +doc/immutable: This setting cannot be changed after the MetadataService has been created.
3232
MetadataService *ArangoMLExtensionSpecMetadataService `json:"metadataService,omitempty"`
3333

34-
// Storage specifies the ArangoMLStorage used within Extension
34+
// Storage specifies the ArangoMLStorage used within Extension, if extension storage is used
3535
Storage *sharedApi.Object `json:"storage,omitempty"`
3636

3737
// ArangoMLExtensionTemplate define Init job specification
@@ -45,6 +45,11 @@ type ArangoMLExtensionSpec struct {
4545

4646
// IntegrationSidecar define the integration sidecar spec
4747
IntegrationSidecar *schedulerIntegrationApi.Sidecar `json:"integrationSidecar,omitempty"`
48+
49+
// ArangoMLExtensionSpecStorageType defines storage used for extension
50+
// +doc/enum: extension|Uses AragoMLStorage
51+
// +doc/enum: platform|Uses AragoPlatformStorage
52+
StorageType *ArangoMLExtensionSpecStorageType `json:"storageType,omitempty"`
4853
}
4954

5055
func (a *ArangoMLExtensionSpec) GetMetadataService() *ArangoMLExtensionSpecMetadataService {
@@ -71,6 +76,14 @@ func (a *ArangoMLExtensionSpec) GetStorage() *sharedApi.Object {
7176
return a.Storage
7277
}
7378

79+
func (a *ArangoMLExtensionSpec) GetStorageType() ArangoMLExtensionSpecStorageType {
80+
if a == nil {
81+
return ArangoMLExtensionSpecStorageTypeDefault
82+
}
83+
84+
return a.StorageType.Get()
85+
}
86+
7487
func (a *ArangoMLExtensionSpec) GetDeployment() *ArangoMLExtensionSpecDeployment {
7588
if a == nil || a.Deployment == nil {
7689
return nil
@@ -99,7 +112,7 @@ func (a *ArangoMLExtensionSpec) Validate() error {
99112

100113
return shared.WithErrors(shared.PrefixResourceErrors("spec",
101114
shared.PrefixResourceErrors("metadataService", a.GetMetadataService().Validate()),
102-
shared.PrefixResourceErrors("storage", shared.ValidateRequired(a.GetStorage(), func(obj sharedApi.Object) error { return obj.Validate() })),
115+
shared.PrefixResourceErrors("storage", shared.ValidateOptionalInterface(a.GetStorage())),
103116
shared.PrefixResourceErrors("init", a.GetInit().Validate()),
104117
shared.PrefixResourceErrors("deployment", a.GetDeployment().Validate()),
105118
shared.PrefixResourceErrors("jobsTemplates", a.GetJobsTemplates().Validate()),
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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 v1beta1
22+
23+
import "github.com/arangodb/kube-arangodb/pkg/util/errors"
24+
25+
type ArangoMLExtensionSpecStorageType string
26+
27+
const (
28+
ArangoMLExtensionSpecStorageTypeDefault = ArangoMLExtensionSpecStorageTypeExtension
29+
ArangoMLExtensionSpecStorageTypeExtension ArangoMLExtensionSpecStorageType = "extension"
30+
ArangoMLExtensionSpecStorageTypePlatform ArangoMLExtensionSpecStorageType = "platform"
31+
)
32+
33+
func (a *ArangoMLExtensionSpecStorageType) Get() ArangoMLExtensionSpecStorageType {
34+
if a == nil {
35+
return ArangoMLExtensionSpecStorageTypeDefault
36+
}
37+
38+
return *a
39+
}
40+
41+
func (a *ArangoMLExtensionSpecStorageType) Validate() error {
42+
switch t := a.Get(); t {
43+
case ArangoMLExtensionSpecStorageTypeExtension, ArangoMLExtensionSpecStorageTypePlatform:
44+
return nil
45+
default:
46+
return errors.Errorf("Invalid Storage Type: %s", t)
47+
}
48+
}

pkg/apis/ml/v1beta1/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/crd/crds/ml-extension.schema.generated.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26986,7 +26986,7 @@ v1beta1:
2698626986
type: object
2698726987
type: object
2698826988
storage:
26989-
description: Storage specifies the ArangoMLStorage used within Extension
26989+
description: Storage specifies the ArangoMLStorage used within Extension, if extension storage is used
2699026990
properties:
2699126991
checksum:
2699226992
description: UID keeps the information about object Checksum
@@ -27001,6 +27001,12 @@ v1beta1:
2700127001
description: UID keeps the information about object UID
2700227002
type: string
2700327003
type: object
27004+
storageType:
27005+
description: ArangoMLExtensionSpecStorageType defines storage used for extension
27006+
enum:
27007+
- extension
27008+
- platform
27009+
type: string
2700427010
type: object
2700527011
status:
2700627012
description: Object with preserved fields for backward compatibility

0 commit comments

Comments
 (0)