I am getting below error in logstash logs. I have configured the certs as configmap, after deploying it I am able to view the certs inside the pod as well but still getting the error.
output {
elasticsearch {
hosts => [ "https://es-es.eck-elasticsearch-es-http.eck.svc:9200" ]
user => "elastic"
password => "******"
ssl_certificate_authorities => "/usr/share/logstash/certs/elastic-stack-ca.pem"
}
}
podTemplate:
spec:
containers:
- name: eck-logstash
image: docker.elastic.co/logstash/logstash:8.14.1
# env:
# - name: ssl_certificate_authorities
# value: "/etc/logstash/certs/elastic-stack-ca.pem"
volumeMounts:
- name: logstash-ca
mountPath: /usr/share/logstash/certs/
readOnly: true
volumes:
- name: logstash-ca
configMap:
name: logstash-certs
ERROR FROM LOGSTASH LOGS
[ERROR][logstash.outputs.elasticsearch] Invalid setting for elasticsearch output plugin:
output {
elasticsearch {
# This setting must be a path
# ["File does not exist or cannot be opened /etc/logstash/certs/elastic-stack-ca.pem"]
ssl_certificate_authorities => "/etc/logstash/certs/elastic-stack-ca.pem"
...
}
}
I have extracted the certs from elastic search secret as a ‘.pem’ file.
Created the configmap
kubectl create configmap logstash-certs --from-file=./elastic-stack-ca.pem -n eck
Then mounted the configmap in the logstash pod as a volume.
jericho is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.