Skip to content
Open
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 @@ -15,6 +15,7 @@
- (Bugfix) (Platform) Ensure Inventory picks active leader
- (Bugfix) (Platform) Reload Config on Inventory Change
- (Bugfix) (Platform) Ensure Inventory uses the serving group for license generation
- (Bugfix) (Platform) Installer move to OCI

## [1.3.1](https://github.com/arangodb/kube-arangodb/tree/1.3.1) (2025-10-07)
- (Documentation) Add ArangoPlatformStorage Docs & Examples
Expand Down
26 changes: 13 additions & 13 deletions docs/cli/arangodb_operator_platform.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ Available Commands:
import Imports the package from the ZIP format
install Installs the specified setup of the platform
merge Merges definitions into single file
registry Points all images to the new registry

Flags:
-h, --help help for package
Expand Down Expand Up @@ -83,9 +82,13 @@ Usage:
arangodb_operator_platform package install [flags] ... packages

Flags:
-h, --help help for install
--platform.endpoint string Platform Repository URL (default "https://arangodb-platform-prd-chart-registry.s3.amazonaws.com")
--platform.name string Kubernetes Platform Name (name of the ArangoDeployment)
-h, --help help for install
--license.client.id string LicenseManager Client ID (ENV: LICENSE_CLIENT_ID)
--license.client.secret string LicenseManager Client Secret (ENV: LICENSE_CLIENT_SECRET)
--license.endpoint string LicenseManager Endpoint (default "license.arango.ai")
--platform.name string Kubernetes Platform Name (name of the ArangoDeployment)
--registry.docker.credentials Use Docker Credentials
--registry.docker.insecure strings List of insecure registries

Global Flags:
--kubeconfig string Kubernetes Config File
Expand Down Expand Up @@ -161,9 +164,8 @@ Flags:
--arango.insecure Arango Endpoint Insecure
--arango.token string Arango JWT Token for Authentication
-h, --help help for activate
--license.client.id string LicenseManager Client ID
--license.client.secret string LicenseManager Client Secret
--license.client.stage strings LicenseManager Stages (default [prd])
--license.client.id string LicenseManager Client ID (ENV: LICENSE_CLIENT_ID)
--license.client.secret string LicenseManager Client Secret (ENV: LICENSE_CLIENT_SECRET)
--license.endpoint string LicenseManager Endpoint (default "license.arango.ai")
--license.interval duration Interval of the license synchronization
--telemetry Enables Telemetry (default true)
Expand All @@ -187,9 +189,8 @@ Flags:
--deployment.id string Deployment ID
-h, --help help for generate
--inventory string Path to the Inventory File
--license.client.id string LicenseManager Client ID
--license.client.secret string LicenseManager Client Secret
--license.client.stage strings LicenseManager Stages (default [prd])
--license.client.id string LicenseManager Client ID (ENV: LICENSE_CLIENT_ID)
--license.client.secret string LicenseManager Client Secret (ENV: LICENSE_CLIENT_SECRET)
--license.endpoint string LicenseManager Endpoint (default "license.arango.ai")

Global Flags:
Expand All @@ -209,9 +210,8 @@ Usage:

Flags:
-h, --help help for secret
--license.client.id string LicenseManager Client ID
--license.client.secret string LicenseManager Client Secret
--license.client.stage strings LicenseManager Stages (default [prd])
--license.client.id string LicenseManager Client ID (ENV: LICENSE_CLIENT_ID)
--license.client.secret string LicenseManager Client Secret (ENV: LICENSE_CLIENT_SECRET)
--license.endpoint string LicenseManager Endpoint (default "license.arango.ai")
--secret string Kubernetes Secret Name

Expand Down
21 changes: 21 additions & 0 deletions pkg/deployment/reconcile/action_license_generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ package reconcile

import (
"context"
"encoding/base64"
"fmt"
"math"
"time"
Expand All @@ -32,6 +33,7 @@ import (

api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1"
"github.com/arangodb/kube-arangodb/pkg/deployment/client"
"github.com/arangodb/kube-arangodb/pkg/deployment/patch"
"github.com/arangodb/kube-arangodb/pkg/deployment/pod"
lmanager "github.com/arangodb/kube-arangodb/pkg/license_manager"
"github.com/arangodb/kube-arangodb/pkg/platform/inventory"
Expand Down Expand Up @@ -216,6 +218,25 @@ func (a *actionLicenseGenerate) Start(ctx context.Context) (bool, error) {
}
}

if spec.Sync.IsEnabled() {
if !spec.License.HasSecretName() {
a.log.Debug("License Secret Gone")
return true, nil
}
s, ok := cache.Secret().V1().GetSimple(spec.License.GetSecretName())
if !ok {
a.log.Debug("License Secret Gone")
return true, nil
}

if _, _, err := patcher.Patcher[*core.Secret](ctx, cache.Client().Kubernetes().CoreV1().Secrets(a.actionCtx.GetNamespace()), s, meta.PatchOptions{}, func(in *core.Secret) []patch.Item {
return []patch.Item{patch.ItemReplace(patch.NewPath("data", utilConstants.SecretKeyToken), base64.StdEncoding.EncodeToString([]byte(generatedLicense.License)))}
}); err != nil {
a.log.Err(err).Debug("Failed to patch License Secret")
return true, nil
}
}

if err := a.actionCtx.WithStatusUpdate(ctx, func(s *api.DeploymentStatus) bool {
s.License = &api.DeploymentStatusLicense{
ID: generatedLicense.ID,
Expand Down
15 changes: 11 additions & 4 deletions pkg/deployment/reconcile/plan_builder_license.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,14 @@ func (r *Reconciler) updateClusterLicenseDiscover(spec api.DeploymentSpec, conte
return "", err
}

if l.V2.IsV2Set() {
return api.LicenseModeKey, nil
}

if l.API != nil {
return api.LicenseModeAPI, nil
}

if l.V2.IsV2Set() {
return api.LicenseModeKey, nil
}

return "", errors.Errorf("Unable to discover License mode")
}

Expand Down Expand Up @@ -256,5 +256,12 @@ func (r *Reconciler) updateClusterLicenseAPI(ctx context.Context, spec api.Deplo
return api.Plan{actions.NewClusterAction(api.ActionTypeLicenseClean, "Removing license reference - Registry Change Required")}
}

if spec.Sync.IsEnabled() {
// Feedback of the token is required
if l.V2.V2Hash() != status.License.Hash {
return api.Plan{actions.NewClusterAction(api.ActionTypeLicenseClean, "Removing license reference - Sync Token Required")}
}
}

return nil
}
38 changes: 0 additions & 38 deletions pkg/platform/chart_manager.go

This file was deleted.

28 changes: 1 addition & 27 deletions pkg/platform/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,6 @@ var (
},
}

flagPlatformEndpoint = cli.Flag[string]{
Name: "platform.endpoint",
Description: "Platform Repository URL",
Default: "https://arangodb-platform-prd-chart-registry.s3.amazonaws.com",
Persistent: true,
}

flagUpgradeVersions = cli.Flag[bool]{
Name: "upgrade",
Short: "u",
Expand Down Expand Up @@ -176,26 +169,7 @@ var (
Default: true,
}

flagRegistryUseCredentials = cli.Flag[bool]{
Name: "registry.docker.credentials",
Description: "Use Docker Credentials",
Default: false,
Check: func(in bool) error {
return nil
},
}

flagRegistryInsecure = cli.Flag[[]string]{
Name: "registry.docker.insecure",
Description: "List of insecure registries",
Default: nil,
}

flagRegistryList = cli.Flag[[]string]{
Name: "registry.docker.endpoint",
Description: "List of boosted registries",
Default: nil,
}
flagRegistry = cli.NewRegistry()

flagActivateInterval = cli.Flag[time.Duration]{
Name: "license.interval",
Expand Down
Loading