Skip to content

Commit 367cb08

Browse files
authored
fix: configure index replicas for the legacy Zeebe ES/OS exporter (#6431)
1 parent 5d6923a commit 367cb08

12 files changed

Lines changed: 210 additions & 0 deletions

File tree

charts/camunda-platform-8.10/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1275,6 +1275,7 @@ Please see the corresponding [release guide](../../docs/release.md) to find out
12751275
| `orchestration.exporters.camunda.enabled` | if true, enables the new Camunda exporter. | `true` |
12761276
| `orchestration.exporters.rdbms.enabled` | if true, enables the new RDBMS exporter. | `false` |
12771277
| `orchestration.exporters.zeebe.enabled` | if true, enables the legacy Zeebe Elasticsearch and OpenSearch exporters. | `false` |
1278+
| `orchestration.exporters.zeebe.replicas` | can be used to specify the number of replicas for the legacy Zeebe Elasticsearch and OpenSearch exporter indices. Defaults to orchestration.index.replicas. | `nil` |
12781279
| `orchestration.exporters.appIntegrations.apiKey.secret.inlineSecret` | can be used to provide the apiKey as a plain-text value for non-production usage. | `""` |
12791280
| `orchestration.exporters.appIntegrations.apiKey.secret.existingSecret` | can be used to reference an existing Kubernetes Secret containing the password. | `""` |
12801281
| `orchestration.exporters.appIntegrations.apiKey.secret.existingSecretKey` | defines the key within the existing Kubernetes Secret. | `""` |

charts/camunda-platform-8.10/templates/orchestration/files/_application.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@ zeebe:
343343
url: {{ include "camundaPlatform.elasticsearchURL" . | quote }}
344344
index:
345345
prefix: {{ .Values.optimize.database.elasticsearch.prefix | default .Values.global.elasticsearch.prefix | quote }}
346+
numberOfReplicas: {{ ternary .Values.orchestration.index.replicas .Values.orchestration.exporters.zeebe.replicas (kindIs "invalid" .Values.orchestration.exporters.zeebe.replicas) | quote }}
346347
{{- if .Values.orchestration.retention.enabled }}
347348
retention:
348349
enabled: true
@@ -361,6 +362,7 @@ zeebe:
361362
url: {{ include "camundaPlatform.opensearchURL" . | quote }}
362363
index:
363364
prefix: {{ .Values.optimize.database.opensearch.prefix | default .Values.global.opensearch.prefix | quote }}
365+
numberOfReplicas: {{ ternary .Values.orchestration.index.replicas .Values.orchestration.exporters.zeebe.replicas (kindIs "invalid" .Values.orchestration.exporters.zeebe.replicas) | quote }}
364366
{{- if or .Values.orchestration.data.secondaryStorage.opensearch.aws.enabled .Values.global.opensearch.aws.enabled .Values.optimize.database.opensearch.aws.enabled }}
365367
aws:
366368
enabled: true

charts/camunda-platform-8.10/test/unit/orchestration/configmap_unified_test.go

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,82 @@ func (s *ConfigmapTemplateTest) TestHasLegacyElasticsearchExporter() {
594594
testhelpers.RunTestCasesE(s.T(), s.chartPath, s.release, s.namespace, s.templates, testCases)
595595
}
596596

597+
func (s *ConfigmapTemplateTest) TestLegacyZeebeExporterReplicas() {
598+
testCases := []testhelpers.TestCase{
599+
{
600+
Name: "ESExporterReplicasInheritIndexReplicasByDefault",
601+
Values: map[string]string{
602+
"orchestration.exporters.zeebe.enabled": "true",
603+
"global.elasticsearch.enabled": "true",
604+
},
605+
Verifier: func(t *testing.T, output string, err error) {
606+
require.NoError(t, err)
607+
require.Contains(t, output, "io.camunda.zeebe.exporter.ElasticsearchExporter")
608+
require.Contains(t, output, "numberOfReplicas: \"1\"",
609+
"legacy ES exporter replicas must default to orchestration.index.replicas (1)")
610+
},
611+
},
612+
{
613+
Name: "ESExporterReplicasInheritCustomIndexReplicas",
614+
Values: map[string]string{
615+
"orchestration.exporters.zeebe.enabled": "true",
616+
"global.elasticsearch.enabled": "true",
617+
"orchestration.index.replicas": "3",
618+
},
619+
Verifier: func(t *testing.T, output string, err error) {
620+
require.NoError(t, err)
621+
require.Contains(t, output, "numberOfReplicas: \"3\"",
622+
"legacy ES exporter replicas must inherit a custom orchestration.index.replicas")
623+
},
624+
},
625+
{
626+
Name: "ESExporterReplicasIndependentOverride",
627+
Values: map[string]string{
628+
"orchestration.exporters.zeebe.enabled": "true",
629+
"global.elasticsearch.enabled": "true",
630+
"orchestration.index.replicas": "3",
631+
"orchestration.exporters.zeebe.replicas": "2",
632+
},
633+
Verifier: func(t *testing.T, output string, err error) {
634+
require.NoError(t, err)
635+
require.Contains(t, output, "numberOfReplicas: \"2\"",
636+
"orchestration.exporters.zeebe.replicas must override the inherited value")
637+
},
638+
},
639+
{
640+
Name: "ESExporterReplicasExplicitZero",
641+
Values: map[string]string{
642+
"orchestration.exporters.zeebe.enabled": "true",
643+
"global.elasticsearch.enabled": "true",
644+
"orchestration.exporters.zeebe.replicas": "0",
645+
},
646+
Verifier: func(t *testing.T, output string, err error) {
647+
require.NoError(t, err)
648+
require.Contains(t, output, "numberOfReplicas: \"0\"",
649+
"an explicit orchestration.exporters.zeebe.replicas of 0 must be honored")
650+
},
651+
},
652+
{
653+
Name: "OSExporterReplicas",
654+
Values: map[string]string{
655+
"orchestration.exporters.zeebe.enabled": "true",
656+
"global.elasticsearch.enabled": "false",
657+
"global.opensearch.enabled": "true",
658+
"global.opensearch.url.host": "opensearch.example.com",
659+
"orchestration.exporters.zeebe.replicas": "5",
660+
},
661+
Verifier: func(t *testing.T, output string, err error) {
662+
require.NoError(t, err)
663+
require.Contains(t, output, "io.camunda.zeebe.exporter.opensearch.OpensearchExporter")
664+
require.Contains(t, output, "numberOfReplicas: \"5\"",
665+
"legacy OS exporter must render orchestration.exporters.zeebe.replicas")
666+
},
667+
},
668+
}
669+
670+
testhelpers.RunTestCasesE(s.T(), s.chartPath, s.release, s.namespace, s.templates, testCases)
671+
}
672+
597673
func (s *ConfigmapTemplateTest) TestMultiRegionInitialContactPoints() {
598674
testCases := []testhelpers.TestCase{
599675
{

charts/camunda-platform-8.10/values.schema.extra.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,22 @@
629629
},
630630
"orchestration": {
631631
"properties": {
632+
"exporters": {
633+
"properties": {
634+
"zeebe": {
635+
"properties": {
636+
"replicas": {
637+
"type": [
638+
"number",
639+
"null"
640+
],
641+
"description": "can be used to specify the number of replicas for the legacy Zeebe Elasticsearch and OpenSearch exporter indices. Defaults to orchestration.index.replicas.",
642+
"default": null
643+
}
644+
}
645+
}
646+
}
647+
},
632648
"ingress": {
633649
"properties": {
634650
"grpc": {

charts/camunda-platform-8.10/values.schema.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5744,6 +5744,14 @@
57445744
"type": "boolean",
57455745
"description": "if true, enables the legacy Zeebe Elasticsearch and OpenSearch exporters.",
57465746
"default": false
5747+
},
5748+
"replicas": {
5749+
"type": [
5750+
"number",
5751+
"null"
5752+
],
5753+
"description": "can be used to specify the number of replicas for the legacy Zeebe Elasticsearch and OpenSearch exporter indices. Defaults to orchestration.index.replicas.",
5754+
"default": null
57475755
}
57485756
}
57495757
},

charts/camunda-platform-8.10/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2734,6 +2734,8 @@ orchestration:
27342734
## @param orchestration.exporters.zeebe.enabled if true, enables the legacy Zeebe Elasticsearch and OpenSearch exporters.
27352735
zeebe:
27362736
enabled: false
2737+
## @param orchestration.exporters.zeebe.replicas can be used to specify the number of replicas for the legacy Zeebe Elasticsearch and OpenSearch exporter indices. Defaults to orchestration.index.replicas.
2738+
replicas: ~
27372739
appIntegrations:
27382740
apiKey:
27392741
secret:

charts/camunda-platform-8.9/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1439,6 +1439,7 @@ Please see the corresponding [release guide](../../docs/release.md) to find out
14391439
| `orchestration.exporters.camunda.enabled` | if true, enables the new Camunda exporter. | `true` |
14401440
| `orchestration.exporters.rdbms.enabled` | if true, enables the new RDBMS exporter. | `false` |
14411441
| `orchestration.exporters.zeebe.enabled` | if true, enables the legacy Zeebe Elasticsearch and OpenSearch exporters. | `false` |
1442+
| `orchestration.exporters.zeebe.replicas` | can be used to specify the number of replicas for the legacy Zeebe Elasticsearch and OpenSearch exporter indices. Defaults to orchestration.index.replicas. | `nil` |
14421443
| `orchestration.exporters.appIntegrations.apiKey.secret.inlineSecret` | can be used to provide the apiKey as a plain-text value for non-production usage. | `""` |
14431444
| `orchestration.exporters.appIntegrations.apiKey.secret.existingSecret` | can be used to reference an existing Kubernetes Secret containing the password. | `""` |
14441445
| `orchestration.exporters.appIntegrations.apiKey.secret.existingSecretKey` | defines the key within the existing Kubernetes Secret. | `""` |

charts/camunda-platform-8.9/templates/orchestration/files/_application.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@ zeebe:
343343
url: {{ include "camundaPlatform.elasticsearchURL" . | quote }}
344344
index:
345345
prefix: {{ .Values.optimize.database.elasticsearch.prefix | default .Values.global.elasticsearch.prefix | quote }}
346+
numberOfReplicas: {{ ternary .Values.orchestration.index.replicas .Values.orchestration.exporters.zeebe.replicas (kindIs "invalid" .Values.orchestration.exporters.zeebe.replicas) | quote }}
346347
{{- if .Values.orchestration.retention.enabled }}
347348
retention:
348349
enabled: true
@@ -361,6 +362,7 @@ zeebe:
361362
url: {{ include "camundaPlatform.opensearchURL" . | quote }}
362363
index:
363364
prefix: {{ .Values.optimize.database.opensearch.prefix | default .Values.global.opensearch.prefix | quote }}
365+
numberOfReplicas: {{ ternary .Values.orchestration.index.replicas .Values.orchestration.exporters.zeebe.replicas (kindIs "invalid" .Values.orchestration.exporters.zeebe.replicas) | quote }}
364366
{{- if or .Values.orchestration.data.secondaryStorage.opensearch.aws.enabled .Values.global.opensearch.aws.enabled .Values.optimize.database.opensearch.aws.enabled }}
365367
aws:
366368
enabled: true

charts/camunda-platform-8.9/test/unit/orchestration/configmap_unified_test.go

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,82 @@ func (s *ConfigmapTemplateTest) TestHasLegacyElasticsearchExporter() {
617617
testhelpers.RunTestCasesE(s.T(), s.chartPath, s.release, s.namespace, s.templates, testCases)
618618
}
619619

620+
func (s *ConfigmapTemplateTest) TestLegacyZeebeExporterReplicas() {
621+
testCases := []testhelpers.TestCase{
622+
{
623+
Name: "ESExporterReplicasInheritIndexReplicasByDefault",
624+
Values: map[string]string{
625+
"orchestration.exporters.zeebe.enabled": "true",
626+
"global.elasticsearch.enabled": "true",
627+
},
628+
Verifier: func(t *testing.T, output string, err error) {
629+
require.NoError(t, err)
630+
require.Contains(t, output, "io.camunda.zeebe.exporter.ElasticsearchExporter")
631+
require.Contains(t, output, "numberOfReplicas: \"1\"",
632+
"legacy ES exporter replicas must default to orchestration.index.replicas (1)")
633+
},
634+
},
635+
{
636+
Name: "ESExporterReplicasInheritCustomIndexReplicas",
637+
Values: map[string]string{
638+
"orchestration.exporters.zeebe.enabled": "true",
639+
"global.elasticsearch.enabled": "true",
640+
"orchestration.index.replicas": "3",
641+
},
642+
Verifier: func(t *testing.T, output string, err error) {
643+
require.NoError(t, err)
644+
require.Contains(t, output, "numberOfReplicas: \"3\"",
645+
"legacy ES exporter replicas must inherit a custom orchestration.index.replicas")
646+
},
647+
},
648+
{
649+
Name: "ESExporterReplicasIndependentOverride",
650+
Values: map[string]string{
651+
"orchestration.exporters.zeebe.enabled": "true",
652+
"global.elasticsearch.enabled": "true",
653+
"orchestration.index.replicas": "3",
654+
"orchestration.exporters.zeebe.replicas": "2",
655+
},
656+
Verifier: func(t *testing.T, output string, err error) {
657+
require.NoError(t, err)
658+
require.Contains(t, output, "numberOfReplicas: \"2\"",
659+
"orchestration.exporters.zeebe.replicas must override the inherited value")
660+
},
661+
},
662+
{
663+
Name: "ESExporterReplicasExplicitZero",
664+
Values: map[string]string{
665+
"orchestration.exporters.zeebe.enabled": "true",
666+
"global.elasticsearch.enabled": "true",
667+
"orchestration.exporters.zeebe.replicas": "0",
668+
},
669+
Verifier: func(t *testing.T, output string, err error) {
670+
require.NoError(t, err)
671+
require.Contains(t, output, "numberOfReplicas: \"0\"",
672+
"an explicit orchestration.exporters.zeebe.replicas of 0 must be honored")
673+
},
674+
},
675+
{
676+
Name: "OSExporterReplicas",
677+
Values: map[string]string{
678+
"orchestration.exporters.zeebe.enabled": "true",
679+
"global.elasticsearch.enabled": "false",
680+
"global.opensearch.enabled": "true",
681+
"global.opensearch.url.host": "opensearch.example.com",
682+
"orchestration.exporters.zeebe.replicas": "5",
683+
},
684+
Verifier: func(t *testing.T, output string, err error) {
685+
require.NoError(t, err)
686+
require.Contains(t, output, "io.camunda.zeebe.exporter.opensearch.OpensearchExporter")
687+
require.Contains(t, output, "numberOfReplicas: \"5\"",
688+
"legacy OS exporter must render orchestration.exporters.zeebe.replicas")
689+
},
690+
},
691+
}
692+
693+
testhelpers.RunTestCasesE(s.T(), s.chartPath, s.release, s.namespace, s.templates, testCases)
694+
}
695+
620696
func (s *ConfigmapTemplateTest) TestMultiRegionInitialContactPoints() {
621697
testCases := []testhelpers.TestCase{
622698
{

charts/camunda-platform-8.9/values.schema.extra.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,22 @@
629629
},
630630
"orchestration": {
631631
"properties": {
632+
"exporters": {
633+
"properties": {
634+
"zeebe": {
635+
"properties": {
636+
"replicas": {
637+
"type": [
638+
"number",
639+
"null"
640+
],
641+
"description": "can be used to specify the number of replicas for the legacy Zeebe Elasticsearch and OpenSearch exporter indices. Defaults to orchestration.index.replicas.",
642+
"default": null
643+
}
644+
}
645+
}
646+
}
647+
},
632648
"ingress": {
633649
"properties": {
634650
"grpc": {

0 commit comments

Comments
 (0)