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 @@ -9,6 +9,7 @@
- (Feature) (Platform) Dump CLI switch to Services
- (Feature) (Platform) Fix ImagePullSecrets Merge
- (Feature) (Platform) Update Failed Releases
- (Feature) Add scrape annotations for ArangoD pods

## [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
5 changes: 4 additions & 1 deletion chart/kube-arangodb-arm64/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@ spec:
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }}
release: {{ .Release.Name }}
{{- if .Values.operator.annotations }}
annotations:
platform.arangodb.com/port: "8528"
platform.arangodb.com/scrape: "true"
platform.arangodb.com/scheme: "https"
{{- if .Values.operator.annotations }}
{{ toYaml .Values.operator.annotations | indent 8 }}
{{- end }}
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@ spec:
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }}
release: {{ .Release.Name }}
{{- if .Values.operator.annotations }}
annotations:
platform.arangodb.com/port: "8528"
platform.arangodb.com/scrape: "true"
platform.arangodb.com/scheme: "https"
{{- if .Values.operator.annotations }}
{{ toYaml .Values.operator.annotations | indent 8 }}
{{- end }}
spec:
Expand Down
5 changes: 4 additions & 1 deletion chart/kube-arangodb-enterprise/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@ spec:
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }}
release: {{ .Release.Name }}
{{- if .Values.operator.annotations }}
annotations:
platform.arangodb.com/port: "8528"
platform.arangodb.com/scrape: "true"
platform.arangodb.com/scheme: "https"
{{- if .Values.operator.annotations }}
{{ toYaml .Values.operator.annotations | indent 8 }}
{{- end }}
spec:
Expand Down
5 changes: 4 additions & 1 deletion chart/kube-arangodb/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@ spec:
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }}
release: {{ .Release.Name }}
{{- if .Values.operator.annotations }}
annotations:
platform.arangodb.com/port: "8528"
platform.arangodb.com/scrape: "true"
platform.arangodb.com/scheme: "https"
{{- if .Values.operator.annotations }}
{{ toYaml .Values.operator.annotations | indent 8 }}
{{- end }}
spec:
Expand Down
8 changes: 8 additions & 0 deletions pkg/deployment/deployment_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,14 @@ func (testCase *testCaseStruct) createTestPodData(deployment *Deployment, group
Finalizers: finalizers(group),
}

metrics := deployment.GetSpec().Metrics
if metrics.IsEnabled() {
testCase.ExpectedPod.ObjectMeta.Annotations = map[string]string{
utilConstants.AnnotationMetricsScrapeLabel: "true",
utilConstants.AnnotationMetricsScrapePort: strconv.Itoa(shared.ArangoExporterPort),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Test uses hardcoded port instead of group spec value

The test sets the expected port annotation using shared.ArangoExporterPort directly, but the implementation in pod_creator_arangod.go uses m.GroupSpec.GetExporterPort() which can return a custom port if ExporterPort is configured. The groupSpec is retrieved on line 725 but not used to set the expected port. This mismatch means tests with custom exporter ports would fail, or custom port functionality would go untested.

Fix in Cursor Fix in Web

}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Test ignores deployment/group annotations when setting expected annotations

The test creates expected annotations with only scrape annotations, completely ignoring any deployment-level or group-level annotations. The production code in MemberArangoDPod.Annotations() merges m.Deployment.Annotations with m.GroupSpec.Annotations before adding scrape annotations. If any test case configures custom annotations in the deployment or group spec, the test expectation would be incorrect because it would only expect scrape annotations while the actual pod would contain merged custom annotations plus scrape annotations.

Fix in Cursor Fix in Web

}

groupSpec := testCase.ArangoDeployment.Spec.GetServerGroupSpec(group)
testCase.ExpectedPod.Spec.Tolerations = deployment.resources.CreatePodTolerations(group, groupSpec)

Expand Down
14 changes: 13 additions & 1 deletion pkg/deployment/resources/pod_creator_arangod.go
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,19 @@ func (m *MemberArangoDPod) ApplyPodSpec(p *core.PodSpec) error {
}

func (m *MemberArangoDPod) Annotations() map[string]string {
return collection.MergeAnnotations(m.Deployment.Annotations, m.GroupSpec.Annotations)
// Merge deployment and group annotations and add hardcoded scrape annotation for ArangoD pods
result := collection.MergeAnnotations(m.Deployment.Annotations, m.GroupSpec.Annotations)

// Enable scraping via platform by default for ArangoD (requires metrics sidecar to be enabled)
if m.Deployment.Metrics.IsEnabled() {
if result == nil {
result = map[string]string{}

}
result[utilConstants.AnnotationMetricsScrapeLabel] = "true"
result[utilConstants.AnnotationMetricsScrapePort] = fmt.Sprintf("%d", m.GroupSpec.GetExporterPort())
}
return result
}

func (m *MemberArangoDPod) Profiles() (schedulerApi.ProfileTemplates, error) {
Expand Down
3 changes: 3 additions & 0 deletions pkg/util/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ const (

AnnotationEnforceAntiAffinity = "database.arangodb.com/enforce-anti-affinity" // Key of annotation added to PVC. Value is a boolean "true" or "false"

AnnotationMetricsScrapeLabel = "platform.arangodb.com/scrape"
AnnotationMetricsScrapePort = "platform.arangodb.com/port"

BackupLabelRole = "backup/role"
MLLabelRole = "ml/role"
AnalyticsLabelRole = "analytics/role"
Expand Down