KubernetesでMetricbeatを動かしたときにノードの情報が取れてない問題が発生した
対象バージョン
kubernetes 1.16.2
Metricbeat 7.5.0
調査
調査した結果、10255のポートがdisabled。
10250のポートを使う必要ある。設定を変える必要があることがわかった
kubernetes 1.11から認証不要な外部連携ポートの10255は、kubeadm実行時にデフォルトでdisabledになるという変更が加わったらしい。
https://bon.sytes.net/post/metricbeat-with-kubernetesv1-11.html
[Metricbeat] - kubernetes metricsets get "connection refused" when querying http://${NODE_NAME}:10250/stats/summary on AWS EKS #13774
https://github.com/elastic/beats/issues/13774
対応
変更前
kubernetes.yml: |-
- module: kubernetes
metricsets:
- node
- system
- pod
- container
- volume
period: 10s
host: ${NODE_NAME}
hosts: ["localhost:10255"]
# If using Red Hat OpenShift remove the previous hosts entry and
# uncomment these settings:
#hosts: ["https://${HOSTNAME}:10250"]
#bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
変更後
・「hosts: ["localhost:10255"]」をコメントにする
・hosts: ["https://${HOSTNAME}:10250"]のコメントは外す
・bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/tokenのコメントを外す
・ssl.verification_mode: noneを追加
・以下のコードを追加
processors:
- add_kubernetes_metadata:
in_cluster: true
kubernetes.yml: |-
- module: kubernetes
metricsets:
- node
- system
- pod
- container
- volume
period: 10s
host: ${NODE_NAME}
#hosts: ["localhost:10255"]
# If using Red Hat OpenShift remove the previous hosts entry and
# uncomment these settings:
hosts: ["https://${HOSTNAME}:10250"]
ssl.verification_mode: none
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
processors:
- add_kubernetes_metadata:
in_cluster: true
Author And Source
この問題について(KubernetesでMetricbeatを動かしたときにノードの情報が取れてない問題が発生した), 我々は、より多くの情報をここで見つけました https://qiita.com/rururu_kenken/items/3887ed3b15365f2f1aa5著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .