8000 [Maintenance] Stability Improvements (#1880) · arangodb/kube-arangodb@7ca8518 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7ca8518

Browse files
authored
[Maintenance] Stability Improvements (#1880)
1 parent a7177ee commit 7ca8518
< 8000 /div>

File tree

11 files changed

+50
-12
lines changed

11 files changed

+50
-12
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
- (Maintenance) Update Envoy to v1.32.5
1818
- (Maintenance) Generate CRD with Schemas
1919
- (Feature) DebugPackage Improvements
20+
- (Feature) Improve Bootstrap time
2021

2122
## [1.2.47](https://github.com/arangodb/kube-arangodb/tree/1.2.47) (2025-03-28)
2223
- (Bugfix) Use Profile Annotations

chart/kube-arangodb-arm64/templates/debug/role.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,13 @@ metadata:
1414
release: {{ .Release.Name }}
1515
rules:
1616
- apiGroups:
17+
# Core
1718
- ""
1819
- "apps"
1920
- "batch"
21+
# Arango
22+
- "analytics.arangodb.com"
23+
- "ml.arangodb.com"
2024
resources: ["*"]
2125
verbs: ["get", "list"]
2226
- apiGroups: [""]

chart/kube-arangodb-enterprise-arm64/templates/debug/role.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,13 @@ metadata:
1414
release: {{ .Release.Name }}
1515
rules:
1616
- apiGroups:
17+
# Core
1718
- ""
1819
- "apps"
1920
- "batch"
21+
# Arango
22+
- "analytics.arangodb.com"
23+
- "ml.arangodb.com"
2024
resources: ["*"]
2125
verbs: ["get", "list"]
2226
- apiGroups: [""]

chart/kube-arangodb-enterprise/templates/debug/role.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,13 @@ metadata:
1414
release: {{ .Release.Name }}
1515
rules:
1616
- apiGroups:
17+
# Core
1718
- ""
1819
- "apps"
1920
- "batch"
21+
# Arango
22+
- "analytics.arangodb.com"
23+
- "ml.arangodb.com"
2024
resources: ["*"]
2125
verbs: ["get", "list"]
2226
- apiGroups: [""]

chart/kube-arangodb/templates/debug/role.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,13 @@ metadata:
1414
release: {{ .Release.Name }}
1515
rules:
1616
- apiGroups:
17+
# Core
1718
- ""
1819
- "apps"
1920
- "batch"
21+
# Arango
22+
- "analytics.arangodb.com"
23+
- "ml.arangodb.com"
2024
resources: ["*"]
2125
verbs: ["get", "list"]
2226
- apiGroups: [""]

pkg/apis/scheduler/v1beta1/pod/resources/scheduling.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ func (s *Scheduling) Apply(template *core.PodTemplateSpec) error {
6464
} else {
6565
template.Spec.NodeSelector = map[string]string{}
6666
for k, v := range s.NodeSelector {
67-
template.Spec.NodeSelector[k] = v
67+
if v != "-" {
68+
template.Spec.NodeSelector[k] = v
69+
}
6870
}
6971
}
7072

pkg/crd/apply.go

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,11 @@ func EnsureCRDWithOptions(ctx context.Context, client kclient.Client, opts Ensur
6868

6969
getAccess := verifyCRDAccess(ctx, client, crdName, access.Get)
7070
if !getAccess.Allowed {
71-
logger.Str("crd", crdName).Info("Get Operations is not allowed. Continue")
71+
logger.
72+
Str("crd", crdName).
73+
Str("reason", getAccess.Reason).
74+
Str("evaluationError", getAccess.EvaluationError).
75+
Info("Get Operations is not allowed. Continue")
7276
continue
7377
}
7478

@@ -195,14 +199,20 @@ func tryApplyCRD(ctx context.Context, client kclient.Client, def crds.Definition
195199
c, err := crdDefinitions.Get(ctx, crdName, meta.GetOptions{})
196200
if err != nil {
197201
if !errors.IsNotFound(err) {
198-
logger.Err(err).Str("crd", crdName).Warn("Get Operations is not allowed due to error")
202+
logger.Err(err).
203+
Str("crd", crdName).
204+
Warn("Get Operations is not allowed due to error")
199205
return err
200206
}
201207

202208
createAccess := verifyCRDAccess(ctx, client, crdName, access.Create)
203209

204210
if !createAccess.Allowed {
205-
logger.Str("crd", crdName).Info("Create Operations is not allowed but CRD is missing. Continue")
211+
logger.
212+
Str("crd", crdName).
213+
Str("reason", createAccess.Reason).
214+
Str("evaluationError", createAccess.EvaluationError).
215+
Info("Create Operations is not allowed but CRD is missing. Continue")
206216
return nil
207217
}
208218

@@ -219,7 +229,10 @@ func tryApplyCRD(ctx context.Context, client kclient.Client, def crds.Definition
219229

220230
updateAccess := verifyCRDAccess(ctx, client, crdName, access.Update)
221231
if !updateAccess.Allowed {
222-
logger.Str("crd", crdName).Info("Update Operations is not allowed. Continue")
232+
logger.Str("crd", crdName).
233+
Str("reason", updateAccess.Reason).
234+
Str("evaluationError", updateAccess.EvaluationError).
235+
Info("Update Operations is not allowed. Continue")
223236
return nil
224237
}
225238

pkg/deployment/reconcile/plan_builder_bootstrap.go

Lines changed: 8 additions & 3 deletions
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.
@@ -39,6 +39,8 @@ func (r *Reconciler) createBootstrapPlan(ctx context.Context, apiObject k8sutil.
3939
return nil
4040
}
4141

42+
var plan api.Plan
43+
4244
for user, secret := range spec.Bootstrap.PasswordSecretNames {
4345
if secret.IsNone() {
4446
continue
@@ -52,8 +54,11 @@ func (r *Reconciler) createBootstrapPlan(ctx context.Context, apiObject k8sutil.
5254
}
5355
}
5456

55-
return api.Plan{actions.NewClusterAction(api.ActionTypeBootstrapSetPassword, "Updating password").AddParam("user", user)}
57+
plan = append(plan, actions.NewClusterAction(api.ActionTypeBootstrapSetPassword, "Updating password").AddParam("user", user))
5658
}
5759

58-
return api.Plan{actions.NewClusterAction(api.ActionTypeBootstrapUpdate, "Finalizing bootstrap")}
60+
plan = append(plan, r.updateClusterLicense(ctx, apiObject, spec, status, context)...)
61+
plan = append(plan, actions.NewClusterAction(api.ActionTypeBootstrapUpdate, "Finalizing bootstrap"))
62+
63+
return plan
5964
}

pkg/deployment/reconcile/plan_builder_high.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ func (r *Reconciler) updateMemberRotationConditions(apiObject k8sutil.APIObject,
262262
}
263263
// We need to do graceful rotation
264264
if member.Conditions.IsTrue(api.ConditionTypePendingRestart) {
265-
return nil, nil
265+
return restartMemberConditionAction(group, member.ID, reason), nil
266266
}
267267

268268
switch a := spec.MemberPropagationMode.Get(); a {

pkg/util/k8sutil/access/access.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,9 @@ func VerifyAccessRequest(ctx context.Context, client kclient.Client, in authoriz
144144

145145
if err != nil {
146146
return authorization.SubjectAccessReviewStatus{
147-
Allowed: false,
148-
Reason: fmt.Sprintf("Unable to check access: %s", err.Error()),
147+
Allowed: false,
148+
Reason: fmt.Sprintf("Unable to check access: %s", err.Error()),
149+
EvaluationError: err.Error(),
149150
}
150151
}
151152

pkg/util/k8sutil/inspector/constants/kubernetes_extension_crd_constants.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828
// CustomResourceDefinition
2929
const (
3030
CustomResourceDefinitionGroup = "apiextensions.k8s.io"
31-
CustomResourceDefinitionResource = "customresourcesdefinition"
31+
CustomResourceDefinitionResource = "customresourcedefinitions"
3232
CustomResourceDefinitionKind = "CustomResourceDefinition"
3333
CustomResourceDefinitionVersionV1 = "v1"
3434
)

0 commit comments

Comments
 (0)
0