Skip to content

Commit 1c755bb

Browse files
committed
Add Auto-configure curator retention rule for indexPerNamespace
1 parent c8ba98a commit 1c755bb

File tree

4 files changed

+29
-2
lines changed

4 files changed

+29
-2
lines changed

config/sc-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,6 +1009,11 @@ opensearch:
10091009
# Config for https://www.elastic.co/guide/en/elasticsearch/client/curator/5.8/about.html
10101010
curator:
10111011
enabled: true
1012+
# Defaults used for automatic index-per-namespace patterns in the curator values:
1013+
# - "^[^.].*" (non-system indices)
1014+
# - ".orphaned*" (orphaned indices from removed namespaces)
1015+
indexPerNamespaceDefaultSizeGB: 5000
1016+
indexPerNamespaceDefaultAgeDays: 30
10121017
retention:
10131018
- pattern: other-*
10141019
sizeGB: 5000

config/schemas/config.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6485,6 +6485,16 @@ properties:
64856485
title: OpenSearch Curator Enabled
64866486
type: boolean
64876487
default: true
6488+
indexPerNamespaceDefaultSizeGB:
6489+
title: OpenSearch Curator Index-Per-Namespace Default Size GB
6490+
description: Default size threshold in GB for automatically generated index-per-namespace patterns.
6491+
type: number
6492+
default: 5000
6493+
indexPerNamespaceDefaultAgeDays:
6494+
title: OpenSearch Curator Index-Per-Namespace Default Age Days
6495+
description: Default age threshold in days for automatically generated index-per-namespace patterns.
6496+
type: number
6497+
default: 30
64886498
retention:
64896499
title: OpenSearch Curator Retention
64906500
description: Configures the retention of indices in OpenSearch.

helmfile.d/charts/opensearch/curator/values.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ opensearch:
1515

1616
startingDeadlineSeconds: 300
1717
activeDeadlineSeconds: 1800
18-
1918
failedJobsHistoryLimit: 3
2019
successfulJobsHistoryLimit: 1
2120

helmfile.d/values/opensearch/curator.yaml.gotmpl

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,20 @@ tolerations: {{- toYaml .Values.opensearch.curator.tolerations | nindent 2 }}
1010
nodeSelector: {{- toYaml .Values.opensearch.curator.nodeSelector | nindent 2 }}
1111
resources: {{- toYaml .Values.opensearch.curator.resources | nindent 2 }}
1212

13-
retention: {{ toYaml .Values.opensearch.curator.retention | nindent 2 }}
13+
retention:
14+
{{- if .Values.opensearch.indexPerNamespace }}
15+
- pattern: "^[^.].*"
16+
sizeGB: {{ .Values.opensearch.curator.indexPerNamespaceDefaultSizeGB }}
17+
ageDays: {{ .Values.opensearch.curator.indexPerNamespaceDefaultAgeDays }}
18+
- pattern: ".orphaned*"
19+
sizeGB: {{ .Values.opensearch.curator.indexPerNamespaceDefaultSizeGB }}
20+
ageDays: {{ .Values.opensearch.curator.indexPerNamespaceDefaultAgeDays }}
21+
{{- end }}
22+
{{- range .Values.opensearch.curator.retention }}
23+
- pattern: {{ .pattern | quote }}
24+
sizeGB: {{ .sizeGB }}
25+
ageDays: {{ .ageDays }}
26+
{{- end }}
1427

1528
{{- $global := dict
1629
"registry" (ternary (dig "uri" "" .Values.images.global.registry) "" .Values.images.global.registry.enabled)

0 commit comments

Comments
 (0)