二、部署node-exporter cat case2-daemonset-deploy-node-exporter.yaml apiVersion: apps/v1 kind: DaemonSet metadata: name: node-exporternamespace: monitor labels: k8s-app: node-exporter spec: selector: matchLabels: k8s-app: node-exporter template: metadata: labels: k8s-app: node-exporter spec: ...
metadata: name: cadvisor namespace: monitoring spec: replicas: 1 selector: matchLabels: app: cadvisor template: metadata: labels: app: cadvisor spec: containers: - name: cadvisor image: k8s.gcr.io/cadvisor:v0.38.3 resources: requests: cpu: 100m memory: 100Mi limits: cpu: 200m memory: 20...
容器监听8080端口用于提供cAdvisor的Web界面。 ### STEP 4: 创建cAdvisor服务 在进行下一步之前,我们需要为cAdvisor创建一个Service,以便其他组件可以通过Service访问cAdvisor。在cadvisor-deployment.yaml所在的目录下,创建一个名为cadvisor-service.yaml的文件,并将以下代码复制到该文件中: ```yaml apiVersion: v1 kin...
首先,需要搭建环境,确保所有的组件(Prometheus Server、Node Exporter、cAdvisor、kube-state-metrics)都运行在各自指定的节点上。例如,Prometheus Server部署在IP为192.168.3.21的节点上,而Kubernetes集群的节点(如192.168.3.210、211、213)则需要安装Node Exporter,用于收集节点级的监控数据。其次,...