1. 程式人生 > 其它 >k8s grafana的pod中執行下載grafana外掛報錯

k8s grafana的pod中執行下載grafana外掛報錯

pod中執行grafana-cli plugins install grafana-clock-panel 出現以下報錯:


Failed to send requesterrorGet https://grafana.com/api/plugins/repo/grafana-kubernetes-app: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) Error: ✗ Failed to send request. error: Get https://grafana.com/api/plugins/repo/grafana-kubernetes-app: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) NAME: Grafana cli plugins install - install <plugin id> <plugin version (optional)> USAGE: Grafana cli plugins install [arguments...] root@grafana-7486b9bc8c-dw52j:/usr/share/grafana# grafana-cli plugins install grafana-clock-panel Failed to send requesterrorGet https://grafana.com/api/plugins/repo/grafana-clock-panel: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) Error: ✗ Failed to send request. error: Get https://grafana.com/api/plugins/repo/grafana-clock-panel: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) NAME: Grafana cli plugins install - install <plugin id> <plugin version (optional)> USAGE: Grafana cli plugins install [arguments...]

排查思路:

ping 地址發現沒有ping,安裝工具也失敗,使用curl發現報無法解析地址,curl其他地址也無法解析.

檢視/etc/resolv.conf

root@grafana-7486b9bc8c-dw52j:/usr/share/grafana# cat /etc/resolv.conf
nameserver 192.168.0.2
search kube-system.svc.cluster.local svc.cluster.local cluster.local
options ndots:5

  

將dns地址改為 2.2.2.2 即可正常安裝外掛