I am using https://www.elastic.co/blog/shipping-kubernetes-logs-to-elasticsearch-with-filebeat to ship kube logs to elastic search. I have self-signed elastic search host. How can I give certificate information to filebeat in kubernetes?
So, I solved this problem by adding self-signed certificate in filebeat daemonset. Anyone who wants to add can do it by following steps. Mount path depends on OS in which your container is running, I am assuming ubuntu:
Create secret with following code :
apiVersion: v1
kind: Secret
metadata:
name: self-signed-certificate-secret
data:
ca-certificates.crt: <base 64 encoded string of certificate>
Then edit filebeat-kubernets.yaml file. In daemonset section add the following line:
volumeMounts:
- name: cert
mountPath: /etc/ssl/certs
In volumes section add information related to volume mount cert:
volumes:
- name: cert
secret:
secretName: self-signed-certificate-secret
defaultMode: 0400