cilium 对接 Prometheus 和 Grafana

参考文档:https://www.cnblogs.com/rainbond/p/16130136.html

一:cilium 安装:

cilium install --helm-set prometheus.enabled=true,operator.prometheus.enabled=true,hubble.enabled=true,hubble.metrics.enabled="{dns,drop,tcp,flow,port-distribution,icmp,http}",tunnel=vxlan,ipam.mode=kubernetes

二:Prometheus 和 Grafana 配置

kubectl apply -f https://raw.githubusercontent.com/cilium/cilium/1.12.1/examples/kubernetes/addons/prometheus/monitoring-example.yaml

三:确认运行状态

$ kubectl get po -n cilium-monitoring
NAME                          READY   STATUS    RESTARTS   AGE
grafana-d69c97b9b-5ztrj       1/1     Running   0          5d20h
prometheus-655fb888d7-456n4   1/1     Running   0          5d20h
$ kubectl get svc -n cilium-monitoring
NAME         TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGE
grafana      ClusterIP   10.43.230.15    <none>        3000/TCP   5d20h
prometheus   ClusterIP   10.43.219.180   <none>        9090/TCP   5d20h

四:开启对外访问

kubectl -n cilium-monitoring port-forward service/grafana --address 0.0.0.0 --address :: 3000:3000
kubectl -n cilium-monitoring port-forward service/prometheus --address 0.0.0.0 --address :: 9090:9090

 

posted @ 2022-09-05 15:40  salami_china  阅读(187)  评论(0编辑  收藏  举报