Skip to content

Commit 82bd2d2

Browse files
fix(chart/data-prepper) Remove demo pipeline from values, add explicit demo value (#634)
* Remove demo pipeline from values file Signed-off-by: Jan Høydahl <[email protected]> * Fixing Minor Linting Issues Signed-off-by: Aaron Layfield <[email protected]> * 0.3.0 Signed-off-by: Aaron Layfield <[email protected]> * Make demo pipeline default to true when no other explicit pipeline is configured. Signed-off-by: Jan Høydahl <[email protected]> --------- Signed-off-by: Jan Høydahl <[email protected]> Signed-off-by: Aaron Layfield <[email protected]> Co-authored-by: Jan Høydahl <[email protected]> Co-authored-by: Aaron Layfield <[email protected]>
1 parent 78833d6 commit 82bd2d2

File tree

8 files changed

+86
-151
lines changed

8 files changed

+86
-151
lines changed

charts/data-prepper/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [0.3.0]
8+
### Added
9+
- Demo pipeline not part of values.yaml. New value `pipelineConfig.demoPipeline` controls creation of demo pipeline.
10+
711
## [0.2.0]
812
### Added
913
- Added configurable `global.dockerRegistry`

charts/data-prepper/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.2.0
18+
version: 0.3.0
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to

charts/data-prepper/README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ helm repo update
3333
helm install my-data-prepper-release opensearch/data-prepper
3434
```
3535

36-
Replace my-data-prepper-release with your desired release name.
36+
Replace my-data-prepper-release with your desired release name. When no explicit pipeline is defined, this will configure a demo pipeline using a random source and stdout sink.
3737

3838
## Configuration
3939

4040
The Data Prepper Helm chart comes with a variety of configuration options to tailor the deployment to your needs.
41-
The default values are specified in the [values.yaml](values.yaml) file. You can override these values by providing your own values.yaml file during installation or by specifying configuration options with --set flags.
41+
The default values are specified in the [values.yaml](values.yaml) file. You can override these values by providing your own `values.yaml` file during installation or by specifying configuration options with --set flags.
4242

4343
For a detailed list of configuration options, refer to the values.yaml file or the [Data Prepper documentation](https://opensearch.org/docs/latest/data-prepper/managing-data-prepper/configuring-data-prepper/).
4444

@@ -99,8 +99,11 @@ We welcome contributions! Please read our [CONTRIBUTING.md](../../CONTRIBUTING.m
9999
| ingress.tls | list | `[]` | |
100100
| nameOverride | string | `""` | Override the default name for the deployment |
101101
| nodeSelector | object | `{}` | |
102-
| pipelineConfig | object | `{"config":{"simple-sample-pipeline":{"buffer":{"bounded_blocking":{"batch_size":256,"buffer_size":1024}},"delay":5000,"processor":[{"string_converter":{"upper_case":true}}],"sink":[{"stdout":null}],"source":{"random":null},"workers":2}},"enabled":true,"existingSecret":""}` | Pipeline configuration |
103-
| pipelineConfig.existingSecret | string | `""` | The name of the existing secret containing the pipeline configuration. If enabled is false existingSecret is used. The existingSecret must have a key named `pipelines.yaml`. |
102+
| pipelineConfig | object | (See below) | Pipeline configuration |
103+
| pipelineConfig.enabled | boolean | `false` | Enable inline configuration in `config` sub key. |
104+
| pipelineConfig.config | object | `{}` | Pipeline configuration file inline if `enabled` is set to true |
105+
| pipelineConfig.demoPipeline | boolean | "" | If set, a demo pipeline will be provisioned with source `random` and sink `stdout`. |
106+
| pipelineConfig.existingSecret | string | `""` | The name of an existing secret containing the pipeline configuration. If enabled is false existingSecret is used. The existingSecret must have a key named `pipelines.yaml`. |
104107
| podAnnotations | object | `{}` | |
105108
| podLabels | object | `{}` | |
106109
| podSecurityContext | object | `{}` | |

charts/data-prepper/templates/NOTES.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,11 @@
2020
echo "Visit http://127.0.0.1:8080 to use your application"
2121
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
2222
{{- end }}
23+
24+
{{- if eq "true" (include "data-prepper.demoPipeline" .) }}
25+
The demo pipeline configuration is enabled, using the `random` source and `stdout` sink.
26+
{{- else if .Values.pipelineConfig.enabled }}
27+
Inline pipeline configuration is enabled. Please refer to the values.yaml file for the configuration.
28+
{{- else }}
29+
Pipeline configuration from secret {{ .Values.pipelineConfig.existingSecret }} is enabled.
30+
{{- end }}

charts/data-prepper/templates/_helpers.tpl

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,25 @@ Create the dockerRegistry prefix if defined
7171
{{- .Values.global.dockerRegistry | trimSuffix "/" | printf "%s/" -}}
7272
{{- end -}}
7373
{{- end -}}
74+
75+
{{/*
76+
Utility to decide whether demoPipeline should be enabled.
77+
If pipelineConfig.demoPipeline is true/false, return that value.
78+
If pipelineConfig.demoPipeline is undefined, return true if no other pipeline is configured.
79+
*/}}
80+
{{- define "data-prepper.demoPipeline" -}}
81+
{{- $demoPipeline := .Values.pipelineConfig.demoPipeline | toString -}}
82+
{{- if eq $demoPipeline "true" -}}
83+
{{ true }}
84+
{{- else if eq $demoPipeline "false" -}}
85+
{{ false }}
86+
{{- else if or (not $demoPipeline) (eq $demoPipeline "") -}}
87+
{{- if and (not .Values.pipelineConfig.enabled) (not .Values.pipelineConfig.existingSecret) -}}
88+
{{ true }}
89+
{{- else -}}
90+
{{ false }}
91+
{{- end -}}
92+
{{- else -}}
93+
{{ false }}
94+
{{- end -}}
95+
{{- end -}}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{{- if eq "true" (include "data-prepper.demoPipeline" .) }}
2+
apiVersion: v1
3+
kind: Secret
4+
metadata:
5+
name: {{ include "data-prepper.fullname" . }}-demo-pipeline
6+
labels:
7+
{{- include "data-prepper.labels" . | nindent 4 }}
8+
type: Opaque
9+
stringData:
10+
pipelines.yaml: |
11+
simple-sample-pipeline:
12+
workers: 2 # the number of workers
13+
delay: 5000 # in milliseconds, how long workers wait between read attempts
14+
source:
15+
random: {}
16+
buffer:
17+
bounded_blocking:
18+
buffer_size: 1024 # max number of records the buffer accepts
19+
batch_size: 256 # max number of records the buffer drains after each read
20+
processor:
21+
- string_converter:
22+
upper_case: true
23+
sink:
24+
- stdout: {}
25+
{{- end }}

charts/data-prepper/templates/deployment.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,12 @@ spec:
9090
name: {{ include "data-prepper.fullname" . }}-config
9191
- name: data-prepper-pipelines
9292
secret:
93-
{{- if .Values.pipelineConfig.enabled }}
93+
{{- if eq "true" (include "data-prepper.demoPipeline" .) }}
94+
secretName: {{ include "data-prepper.fullname" . }}-demo-pipeline
95+
{{- else if .Values.pipelineConfig.enabled }}
9496
secretName: {{ include "data-prepper.fullname" . }}-pipeline
9597
{{- else }}
96-
secretName: {{ required "A valid .Values.pipelineConfig.existingSecret entry required!" .Values.pipelineConfig.existingSecret }}
98+
secretName: {{ required "A valid pipeline configuration is required! Please set one of:\npipelineConfig.existingSecret - for your custom pipeline secret\npipelineConfig.enabled - for inline configuration in values.yaml or\npipelineConfig.demoPipeline=true - for a sample demo pipeline using random source and stdout sink." .Values.pipelineConfig.existingSecret }}
9799
{{- end }}
98100
{{- with .Values.volumes }}
99101
{{- toYaml . | nindent 8 }}

charts/data-prepper/values.yaml

Lines changed: 15 additions & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -101,160 +101,31 @@ config:
101101

102102
# -- Pipeline configuration
103103
pipelineConfig:
104-
# If enabled, a secret containing the pipeline configuration will be created based on the 'config' section below.
105-
enabled: true
104+
# If 'true', a secret containing a demo pipeline configuration with random source and stdout sink will be created.
105+
# If left undefined, the demo pipeline will be used only when no other pipeline is configured below
106+
demoPipeline: ""
106107
# -- The name of the existing secret containing the pipeline configuration.
107108
# If enabled is false existingSecret is used. The existingSecret must have a key named `pipelines.yaml`.
108109
existingSecret: ""
110+
# If enabled, a secret containing the pipeline configuration will be created based on the 'config' section below.
111+
enabled: false
109112
# The configuration of the pipeline see https://opensearch.org/docs/2.4/data-prepper/pipelines/pipelines/
110113
config:
111-
## Simple Example
112-
simple-sample-pipeline:
113-
workers: 2 # the number of workers
114-
delay: 5000 # in milliseconds, how long workers wait between read attempts
115-
source:
116-
random:
117-
buffer:
118-
bounded_blocking:
119-
buffer_size: 1024 # max number of records the buffer accepts
120-
batch_size: 256 # max number of records the buffer drains after each read
121-
processor:
122-
- string_converter:
123-
upper_case: true
124-
sink:
125-
- stdout:
126-
127-
## More Complex example
128-
# otel-logs-pipeline:
129-
# workers: 5
130-
# delay: 10
131-
# source:
132-
# otel_logs_source:
133-
# ssl: false
134-
# buffer:
135-
# bounded_blocking:
136-
# sink:
137-
# - opensearch:
138-
# hosts: ["https://opensearch-cluster-master:9200"]
139-
# username: "admin"
140-
# password: "admin"
141-
# insecure: true
142-
# index_type: custom
143-
# index: events-%{yyyy.MM.dd}
144-
# #max_retries: 20
145-
# bulk_size: 4
146-
# otel-trace-pipeline:
147-
# # workers is the number of threads processing data in each pipeline.
148-
# # We recommend same value for all pipelines.
149-
# # default value is 1, set a value based on the machine you are running Data Prepper
150-
# workers: 8
151-
# # delay in milliseconds is how often the worker threads should process data.
152-
# # Recommend not to change this config as we want the otel-trace-pipeline to process as quick as possible
153-
# # default value is 3_000 ms
154-
# delay: "100"
155-
# source:
156-
# otel_trace_source:
157-
# ssl: false # Change this to enable encryption in transit
158-
# buffer:
159-
# bounded_blocking:
160-
# # buffer_size is the number of ExportTraceRequest from otel-collector the data prepper should hold in memeory.
161-
# # We recommend to keep the same buffer_size for all pipelines.
162-
# # Make sure you configure sufficient heap
163-
# # default value is 12800
164-
# buffer_size: 25600
165-
# # This is the maximum number of request each worker thread will process within the delay.
166-
# # Default is 200.
167-
# # Make sure buffer_size >= workers * batch_size
168-
# batch_size: 400
169-
# sink:
170-
# - pipeline:
171-
# name: "raw-traces-pipeline"
172-
# - pipeline:
173-
# name: "otel-service-map-pipeline"
174-
# raw-traces-pipeline:
175-
# workers: 5
176-
# delay: 3000
177-
# source:
178-
# pipeline:
179-
# name: "otel-trace-pipeline"
180-
# buffer:
181-
# bounded_blocking:
182-
# buffer_size: 25600 # max number of records the buffer accepts
183-
# batch_size: 400 # max number of records the buffer drains after each read
184-
# processor:
185-
# - otel_traces:
186-
# - otel_trace_group:
187-
# hosts: [ "https://opensearch-cluster-master:9200" ]
188-
# insecure: true
189-
# username: "admin"
190-
# password: "admin"
191-
# sink:
192-
# - opensearch:
193-
# hosts: ["https://opensearch-cluster-master:9200"]
194-
# username: "admin"
195-
# password: "admin"
196-
# insecure: true
197-
# index_type: trace-analytics-raw
198-
# otel-service-map-pipeline:
199-
# workers: 5
200-
# delay: 3000
201-
# source:
202-
# pipeline:
203-
# name: "otel-trace-pipeline"
204-
# processor:
205-
# - service_map:
206-
# # The window duration is the maximum length of time the data prepper stores the most recent trace data to evaluvate service-map relationships.
207-
# # The default is 3 minutes, this means we can detect relationships between services from spans reported in last 3 minutes.
208-
# # Set higher value if your applications have higher latency.
209-
# window_duration: 180
210-
# buffer:
211-
# bounded_blocking:
212-
# # buffer_size is the number of ExportTraceRequest from otel-collector the data prepper should hold in memeory.
213-
# # We recommend to keep the same buffer_size for all pipelines.
214-
# # Make sure you configure sufficient heap
215-
# # default value is 12800
216-
# buffer_size: 25600
217-
# # This is the maximum number of request each worker thread will process within the delay.
218-
# # Default is 200.
219-
# # Make sure buffer_size >= workers * batch_size
220-
# batch_size: 400
221-
# sink:
222-
# - opensearch:
223-
# hosts: ["https://opensearch-cluster-master:9200"]
224-
# username: "admin"
225-
# password: "admin"
226-
# insecure: true
227-
# index_type: trace-analytics-service-map
228-
# #index: otel-v1-apm-span-%{yyyy.MM.dd}
229-
# #max_retries: 20
230-
# bulk_size: 4
231-
# otel-metrics-pipeline:
232-
# workers: 8
233-
# delay: 3000
114+
## Provide your pipeline configuration here if 'enabled' is set to true. See documentation for more advanced pipelines
115+
# simple-sample-pipeline:
116+
# workers: 2 # the number of workers
117+
# delay: 5000 # in milliseconds, how long workers wait between read attempts
234118
# source:
235-
# otel_metrics_source:
236-
# health_check_service: true
237-
# ssl: false
119+
# random: {}
238120
# buffer:
239121
# bounded_blocking:
240-
# buffer_size: 1024 # max number of records the buffer accepts
241-
# batch_size: 1024 # max number of records the buffer drains after each read
122+
# buffer_size: 1024 # max number of records the buffer accepts
123+
# batch_size: 256 # max number of records the buffer drains after each read
242124
# processor:
243-
# - otel_metrics:
244-
# calculate_histogram_buckets: true
245-
# calculate_exponential_histogram_buckets: true
246-
# exponential_histogram_max_allowed_scale: 10
247-
# flatten_attributes: false
125+
# - string_converter:
126+
# upper_case: true
248127
# sink:
249-
# - opensearch:
250-
# hosts: ["https://opensearch-cluster-master:9200"]
251-
# username: "admin"
252-
# password: "admin"
253-
# insecure: true
254-
# index_type: custom
255-
# index: metrics-%{yyyy.MM.dd}
256-
# #max_retries: 20
257-
# bulk_size: 4
128+
# - stdout: {}
258129

259130
# -- Data Prepper ports
260131
ports:

0 commit comments

Comments
 (0)