介绍

Netdata可用于监督kubernetes集群并显示无关集群的信息,包含节点内存使用率、CPU、网络等,简略的说,Netdata仪表板可让您全面理解Kubernetes集群,包含在每个节点上运行的服务和Pod。

装置HELM

root@hello:~# curl https://baltocdn.com/helm/signing.asc | sudo apt-key add -root@hello:~# sudo apt-get install apt-transport-https --yesroot@hello:~# echo "deb https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.listroot@hello:~# sudo apt-get updateroot@hello:~# sudo apt-get install helm

增加源并装置

root@hello:~# helm repo add netdata https://netdata.github.io/helmchart/"netdata" has been added to your repositoriesroot@hello:~# helm install netdata netdata/netdataW0420 09:20:51.993046 1306427 warnings.go:70] policy/v1beta1 PodSecurityPolicy is deprecated in v1.21+, unavailable in v1.25+W0420 09:20:52.298158 1306427 warnings.go:70] policy/v1beta1 PodSecurityPolicy is deprecated in v1.21+, unavailable in v1.25+NAME: netdataLAST DEPLOYED: Wed Apr 20 09:20:50 2022NAMESPACE: defaultSTATUS: deployedREVISION: 1TEST SUITE: NoneNOTES:1. netdata will be available on http://netdata.k8s.local/, on the exposed port of your ingress controllerIn a production environment, you  You can get that port via `kubectl get services`. e.g. in the following example, the http exposed port is 31737, the https one is 30069. The hostname netdata.k8s.local will need to be added to /etc/hosts, so that it resolves to the exposed IP. That IP depends on how your cluster is set up:         - When no load balancer is available (e.g. with minikube), you get the IP shown on `kubectl cluster-info`        - In a production environment, the command `kubectl get services` will show the IP under the EXTERNAL-IP columnThe port can be retrieved in both cases from `kubectl get services`NAME                                         TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)                      AGEexiled-tapir-nginx-ingress-controller        LoadBalancer   10.98.132.169    <pending>     80:31737/TCP,443:30069/TCP   11hroot@hello:~# helm listNAME    NAMESPACE       REVISION        UPDATED                                 STATUS          CHART           APP VERSIONnetdata default         1               2022-04-20 09:20:50.947921117 +0800 CST deployed        netdata-3.7.15  v1.33.1    

查看POD

root@hello:~# kubectl  get pod NAME                                      READY   STATUS    RESTARTS      AGEnetdata-child-2h65n                       2/2     Running   0             77snetdata-child-dfv82                       2/2     Running   0             77snetdata-child-h6fw6                       2/2     Running   0             77snetdata-child-lc9fd                       2/2     Running   0             77snetdata-child-nh566                       2/2     Running   0             77snetdata-child-ns2p2                       2/2     Running   0             77snetdata-child-v74x5                       2/2     Running   0             77snetdata-child-xjlrv                       2/2     Running   0             77snetdata-parent-57bf6bf47d-vc6fq           1/1     Running   0             77s

增加SVC使内部即可拜访

root@hello:~# kubectl  get svcNAME         TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)     AGEkubernetes   ClusterIP   10.96.0.1        <none>        443/TCP     18dnetdata      ClusterIP   10.102.160.106   <none>        19999/TCP   3m39sroot@hello:~# kubectl expose  deployment netdata-parent --type="NodePort" --port 19999service/netdata-parent exposedroot@hello:~# kubectl  get svcNAME             TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)           AGEkubernetes       ClusterIP   10.96.0.1        <none>        443/TCP           18dnetdata          ClusterIP   10.102.160.106   <none>        19999/TCP         3m43snetdata-parent   NodePort    10.100.122.173   <none>        19999:30518/TCP   2sroot@hello:~# 通过http://<yourmaster-IP>:30518  拜访浏览器中的netdata仪表板

点击左侧能够查看具体每一台机器的信息

https://www.oiox.cn/
https://www.chenby.cn/
https://cby-chen.github.io/
https://blog.csdn.net/qq\_33921750
https://my.oschina.net/u/3981543
https://www.zhihu.com/people/...
https://segmentfault.com/u/hp...
https://juejin.cn/user/331578...
https://cloud.tencent.com/dev...
https://www.jianshu.com/u/0f8...
https://www.toutiao.com/c/use...
CSDN、GitHub、知乎、开源中国、思否、掘金、简书、腾讯云、今日头条、集体博客、全网可搜《小陈运维》