Skip to content

Commit

Permalink
feat: support elasticsearch module
Browse files Browse the repository at this point in the history
  • Loading branch information
yian-shih committed Aug 22, 2024
1 parent 1dc45eb commit a052ce9
Show file tree
Hide file tree
Showing 12 changed files with 389 additions and 676 deletions.
9 changes: 8 additions & 1 deletion brownie/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,16 @@ KAFKA_PASSWORD=admin

POSTGRESQL_CONFIG_NAMES="server1 server2"

#Elasticsearch
ELASTICSEARCH_BROKER_PROTOCOL=http
ELASTICSEARCH_BROKERS=$LOCAL_HOST_IP
ELASTICSEARCH_PORT=9200
ELASTICSEARCH_USERNAME=admin
ELASTICSEARCH_PASSWORD=admin

ENABLED_MODULES="postgresql=server1;server2,kafka"
BROWNIE_NODE_OPTIONS=--max-heap-size=256
# Pattern with group wich extracts timestamp made of 14 digits: yyyyMMddHHmmss prefixed with "ts"
TIMESTAMP_PATTRN="^.*pit.*_(ts\d{14,14}).*"
TIMESTAMP_PATTERN="^.*pit.*_(ts\d{14,14}).*"
# The format is: <digit><unit>, where unit is "days" or "hours" or "minutes"
RETENTION_PERIOD=5days
22 changes: 22 additions & 0 deletions brownie/deployment/helm/templates/dev-secretstore.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,26 @@ spec:
}
{{- end }}
{{- end }}
{{- if not .Values.ELASTICSEARCH_CONFIG_NAMES }}
- key: {{ .Values.EXTERNAL_SECRET_ELASTICSEARCH_PATH }}
value: |
{
"hostnames": {{ .Values.ELASTICSEARCH_BROKERS | quote }},
"port": {{ .Values.ELASTICSEARCH_PORT | quote }},
"username": {{ .Values.ELASTICSEARCH_USERNAME | quote }},
"password": {{ .Values.ELASTICSEARCH_PASSWORD | quote }}
}
{{- end }}
{{- if .Values.ELASTICSEARCH_CONFIG_NAMES }}
{{- range $cfgName := .Values.ELASTICSEARCH_CONFIG_NAMES }}
- key: {{ $.Values.EXTERNAL_SECRET_ELASTICSEARCH_PATH }}-{{$cfgName | lower}}
value: |
{
"hostnames": {{ (index $.Values (printf "%s_ELASTICSEARCH_BROKERS" ($cfgName | upper))) | quote }},
"port": {{ (index $.Values (printf "%s_ELASTICSEARCH_PORT" ($cfgName | upper))) | quote }},
"username": {{ (index $.Values (printf "%s_ELASTICSEARCH_USERNAME" ($cfgName | upper))) | quote }},
"password": {{ (index $.Values (printf "%s_ELASTICSEARCH_PASSWORD" ($cfgName | upper))) | quote }}
}
{{- end }}
{{- end }}
{{- end }}
38 changes: 38 additions & 0 deletions brownie/deployment/helm/templates/external-secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,42 @@ spec:
key: {{ $.Values.EXTERNAL_SECRET_KAFKA_PATH }}-{{ $cfgName | lower }}
property: password
{{- end }}
{{- end }}
{{- if not .Values.ELASTICSEARCH_CONFIG_NAMES }}
- secretKey: ELASTICSEARCH_BROKERS
remoteRef:
key: {{ $.Values.EXTERNAL_SECRET_ELASTICSEARCH_PATH }}
property: hostnames
- secretKey: ELASTICSEARCH_PORT
remoteRef:
key: {{ $.Values.EXTERNAL_SECRET_ELASTICSEARCH_PATH }}
property: port
- secretKey: ELASTICSEARCH_USERNAME
remoteRef:
key: {{ $.Values.EXTERNAL_SECRET_ELASTICSEARCH_PATH }}
property: username
- secretKey: ELASTICSEARCH_PASSWORD
remoteRef:
key: {{ $.Values.EXTERNAL_SECRET_ELASTICSEARCH_PATH }}
property: password
{{- end }}
{{- if .Values.ELASTICSEARCH_CONFIG_NAMES }}
{{- range $cfgName := .Values.ELASTICSEARCH_CONFIG_NAMES }}
- secretKey: {{ $cfgName }}_ELASTICSEARCH_BROKERS
remoteRef:
key: {{ $.Values.EXTERNAL_SECRET_ELASTICSEARCH_PATH }}-{{ $cfgName | lower }}
property: hostnames
- secretKey: {{ $cfgName | upper }}_ELASTICSEARCH_PORT
remoteRef:
key: {{ $.Values.EXTERNAL_SECRET_ELASTICSEARCH_PATH }}-{{ $cfgName | lower }}
property: port
- secretKey: {{ $cfgName | upper }}_ELASTICSEARCH_USERNAME
remoteRef:
key: {{ $.Values.EXTERNAL_SECRET_ELASTICSEARCH_PATH }}-{{ $cfgName | lower }}
property: username
- secretKey: {{ $cfgName | upper }}_ELASTICSEARCH_PASSWORD
remoteRef:
key: {{ $.Values.EXTERNAL_SECRET_ELASTICSEARCH_PATH }}-{{ $cfgName | lower }}
property: password
{{- end }}
{{- end }}
Loading

0 comments on commit a052ce9

Please sign in to comment.