I have some tools running in my kubernetes cluster (ELK, zipkin,..) and i want to know in which namespace to place them, for example i have fluentd which is a daemonset running in kube-system namespace so should i place elasticsearch in the same namespace or put them together in a custom namespace so they can reach each other, i just want to know what is the best practice to do it
I would say you can have fluentd in multiple namespaces and Elasticsearch in one namespace and fluentd can discover Elasticsearch via K8s internal DNS A/AAAA record e.g. elasticsearch.${namespace}.svc.cluster.local
.
I don't have any link to the best practice, but I would show you a practice I saw from the community.
If you are not familiar with configuring K8s cluster, I recommend to deploy ELK by Helm. It will save you a lot of time and give you enough configuration options. https://github.com/helm/charts/tree/master/stable/elastic-stack.
Install your ELK helm release on a separate
namespace, for example: logging
.
Install fluentd in any namespaces in your cluster and configure elasticsearch host https://github.com/helm/charts/tree/master/stable/fluentd-elasticsearch