Skip to content
Merged
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 @@ -4,6 +4,7 @@
- (Bugfix) (Platform) Fix Container Resource Adjustments
- (Bugfix) (Platform) Fix LM CLI Option
- (Bugfix) (Platform) Fix topology for Gateways
- (Feature) (Platform) Dump CLI switch to Services

## [1.3.2](https://github.com/arangodb/kube-arangodb/tree/1.3.2) (2025-11-20)
- (Bugfix) (Platform) Increase memory limit for Inventory
Expand Down
12 changes: 6 additions & 6 deletions docs/platform.install.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ packages:

### .package.packages.\<string\>.chart

Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.3.2/pkg/util/k8sutil/helm/package.go#L87)</sup>
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.3.2/pkg/util/k8sutil/helm/package.go#L83)</sup>

Chart defines override of the PackageSpec
It supports multiple modes:
Expand All @@ -48,39 +48,39 @@ It supports multiple modes:

### .package.packages.\<string\>.overrides

Type: `Object` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.3.2/pkg/util/k8sutil/helm/package.go#L91)</sup>
Type: `Object` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.3.2/pkg/util/k8sutil/helm/package.go#L87)</sup>

Overrides defines Values to override the Helm Chart Defaults (merged with Service Overrides)

***

### .package.packages.\<string\>.stage

Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.3.2/pkg/util/k8sutil/helm/package.go#L74)</sup>
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.3.2/pkg/util/k8sutil/helm/package.go#L70)</sup>

Stage defines stage used in the fetch from LicenseManager

***

### .package.packages.\<string\>.version

Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.3.2/pkg/util/k8sutil/helm/package.go#L77)</sup>
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.3.2/pkg/util/k8sutil/helm/package.go#L73)</sup>

Version keeps the version of the PackageSpec

***

### .package.releases.\<string\>.overrides

Type: `Object` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.3.2/pkg/util/k8sutil/helm/package.go#L171)</sup>
Type: `Object` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.3.2/pkg/util/k8sutil/helm/package.go#L167)</sup>

Overrides defines Values to override the Helm Chart Defaults during installation

***

### .package.releases.\<string\>.package

Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.3.2/pkg/util/k8sutil/helm/package.go#L167)</sup>
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.3.2/pkg/util/k8sutil/helm/package.go#L163)</sup>

Package keeps the name of the Chart used from the installation script.
References to value provided in Packages
Expand Down
19 changes: 19 additions & 0 deletions pkg/util/k8sutil/helm/charts.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,22 @@ func GetLocalCharts(ctx context.Context, client kclient.Client, namespace string
return in.GetName()
}), nil
}

func GetLocalServices(ctx context.Context, client kclient.Client, namespace string) (map[string]*platformApi.ArangoPlatformService, error) {
l, err := list.ListObjects[*platformApi.ArangoPlatformServiceList, *platformApi.ArangoPlatformService](ctx, client.Arango().PlatformV1beta1().ArangoPlatformServices(namespace), func(result *platformApi.ArangoPlatformServiceList) []*platformApi.ArangoPlatformService {
q := make([]*platformApi.ArangoPlatformService, len(result.Items))

for id, e := range result.Items {
q[id] = e.DeepCopy()
}

return q
})
if err != nil {
return nil, err
}

return util.ListAsMap(l, func(in *platformApi.ArangoPlatformService) string {
return in.GetName()
}), nil
}
60 changes: 12 additions & 48 deletions pkg/util/k8sutil/helm/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,9 @@ import (
"encoding/base64"
goStrings "strings"

"helm.sh/helm/v3/pkg/action"
meta "k8s.io/apimachinery/pkg/apis/meta/v1"

platformApi "github.com/arangodb/kube-arangodb/pkg/apis/platform/v1beta1"
shared "github.com/arangodb/kube-arangodb/pkg/apis/shared"
"github.com/arangodb/kube-arangodb/pkg/util"
utilConstants "github.com/arangodb/kube-arangodb/pkg/util/constants"
"github.com/arangodb/kube-arangodb/pkg/util/errors"
"github.com/arangodb/kube-arangodb/pkg/util/kclient"
)
Expand Down Expand Up @@ -176,16 +172,12 @@ func (p PackageRelease) Validate() error {
}

func NewPackage(ctx context.Context, client kclient.Client, namespace, deployment string) (*Package, error) {
hclient, err := NewClient(Configuration{
Namespace: namespace,
Config: client.Config(),
Driver: nil,
})
charts, err := GetLocalCharts(ctx, client, namespace)
if err != nil {
return nil, err
}

charts, err := GetLocalCharts(ctx, client, namespace)
services, err := GetLocalServices(ctx, client, namespace)
if err != nil {
return nil, err
}
Expand All @@ -198,7 +190,8 @@ func NewPackage(ctx context.Context, client kclient.Client, namespace, deploymen

for name, c := range charts {
if !c.Status.Conditions.IsTrue(platformApi.ReadyCondition) {
return nil, errors.Errorf("Chart `%s` is not in ready condition", name)
logger.Warn("Chart %s is not ready", name)
continue
}

if info := c.Status.Info; info != nil {
Expand All @@ -210,46 +203,17 @@ func NewPackage(ctx context.Context, client kclient.Client, namespace, deploymen
}
}
}
}

existingReleases, err := hclient.List(ctx, func(in *action.List) {
in.Selector = meta.FormatLabelSelector(&meta.LabelSelector{
MatchLabels: map[string]string{
utilConstants.HelmLabelArangoDBManaged: "true",
utilConstants.HelmLabelArangoDBDeployment: deployment,
utilConstants.HelmLabelArangoDBChart: name,
utilConstants.HelmLabelArangoDBType: "platform",
},
})
})
if err != nil {
logger.Err(err).Error("Unable to list releases")
return nil, err
for name, c := range services {
if !c.Status.Conditions.IsTrue(platformApi.ReadyCondition) {
logger.Warn("Service %s is not ready", name)
continue
}

for _, release := range existingReleases {
var r PackageRelease

r.Package = name

data, err := release.Values.Marshal()
if err != nil {
logger.Err(err).Error("Unable to unmarshal values")
return nil, err
}

delete(data, "arangodb_platform")

if len(data) != 0 {
values, err := NewValues(data)
if err != nil {
logger.Err(err).Error("Unable to marshal values")
return nil, err
}

r.Overrides = values
}

out.Releases[release.Name] = r
out.Releases[name] = PackageRelease{
Package: c.Status.Chart.GetName(),
Overrides: Values(c.Spec.Values),
}
}

Expand Down