Skip to content
This repository was archived by the owner on May 16, 2023. It is now read-only.

Commit 24e7b12

Browse files
committed
adjusting logstash to connect to elasticsearch using https
1 parent 6a9c7bd commit 24e7b12

File tree

2 files changed

+32
-3
lines changed

2 files changed

+32
-3
lines changed

Diff for: logstash/templates/statefulset.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,10 @@ spec:
180180
env:
181181
- name: LS_JAVA_OPTS
182182
value: "{{ .Values.logstashJavaOpts }}"
183+
- name: xpack.http.ssl.truststore.path
184+
value: /usr/share/logstash/config/certs/tls.crt
185+
- name: xpack.http.ssl.verification_mode
186+
value: "certificate"
183187
{{- if .Values.extraEnvs }}
184188
{{ toYaml .Values.extraEnvs | indent 10 }}
185189
{{- end }}

Diff for: logstash/values.yaml

+28-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,18 @@ logstashConfig: {}
1515

1616
# Allows you to add any pipeline files in /usr/share/logstash/pipeline/
1717
### ***warn*** there is a hardcoded logstash.conf in the image, override it first
18-
logstashPipeline: {}
18+
logstashPipeline:
19+
logstash.conf: |
20+
input { exec { command => "uptime" interval => 30 } }
21+
output {
22+
elasticsearch {
23+
hosts => ["https://elasticsearch-master:9200"]
24+
cacert => '/usr/share/logstash/config/certs/ca.crt'
25+
user => '${ELASTICSEARCH_USERNAME}'
26+
password => '${ELASTICSEARCH_PASSWORD}'
27+
index => "logstash"
28+
}
29+
}
1930
# logstash.conf: |
2031
# input {
2132
# exec {
@@ -34,7 +45,17 @@ logstashPattern: {}
3445
# Extra environment variables to append to this nodeGroup
3546
# This will be appended to the current 'env:' key. You can use any of the kubernetes env
3647
# syntax here
37-
extraEnvs: []
48+
extraEnvs:
49+
- name: "ELASTICSEARCH_USERNAME"
50+
valueFrom:
51+
secretKeyRef:
52+
name: elasticsearch-master-credentials
53+
key: username
54+
- name: "ELASTICSEARCH_PASSWORD"
55+
valueFrom:
56+
secretKeyRef:
57+
name: elasticsearch-master-credentials
58+
key: password
3859
# - name: MY_ENVIRONMENT_VAR
3960
# value: the_value_goes_here
4061

@@ -62,7 +83,11 @@ secrets: []
6283
# cert.key.filepath: "secrets.crt" # The path to file should be relative to the `values.yaml` file.
6384

6485
# A list of secrets and their paths to mount inside the pod
65-
secretMounts: []
86+
secretMounts:
87+
- name: elasticsearch-master-certs
88+
secretName: elasticsearch-master-certs
89+
path: /usr/share/logstash/config/certs
90+
6691

6792
hostAliases: []
6893
#- ip: "127.0.0.1"

0 commit comments

Comments
 (0)