In this place (at the end of the kubenetes module example):
hosts: ["https://${KUBERNETES_SERVICE_HOST}:${KUBERNETES_SERVICE_PORT}"],
I`ve inserted my Kubernetes API server host and port. When I try to run sudo metricbeat -c /etc/metricbeat/metricbeat.yml test config, I recieve this error:
Exiting: 2 errors: 1 error: fail to get kubernetes client: Unable to
get in cluster configuration: unable to load in-cluster configuration,
KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined; 1
error: metricset 'kubernetes/apiserver' is not registered, metricset
not found.
I tried to export needed enviroment varibles, but reaction was the same. Could anyone help me to solve this problem?
So, i tried different approaches. Firstly, with command export KUBERNETES_SERVICE_HOST and PORT, i defined variables, which i found using command "kubectl cluster-info", also this variables i could find in one of clusters pods yml file as "env": [ { "name": "KUBERNETES_SERVICE_HOST", "value": "xxxxx" }, { "name": "KUBERNETES_SERVICE_PORT", "value": "xxxxx".
But there were no changes in the reaction.
Secondly i tried insert ENV in metricbeat yml config file. As in privious situation, reaction didn`t changed. I also delpoyed Metricbeat as a Daemon set, using kubectl create -f metricbeat-kubernetes.yaml. All works fine. Metricbeat send info about concrete node. But for visualization in kibana, i need (i think so) to send overall information about cluster (pods, nodes and so on), installing metricbeat as service on cluster.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.