怎么给minikube部署prometheus和grafana

本文介绍了如何在单台PC上的minikube环境中部署prometheus和grafana,选择了kube-prometheus全家桶方案,由于CPU限制,采用逐个安装方式。详细步骤包括安装prometheus和grafana,添加数据源,配置Grafana面板,以及监控服务和Pod的注解方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1、方案选择

  • kube-prometheus,全家桶。
  • 分别安装prometheus和grafana
    我也不想选择第二种,但是我就一台普通的PC,安装kube-prometheus直接给我报错CPU不够用了,我~~

2、先尝试第一种,如果成功了就别瞎折腾了,心累~
先看下对应关系,最新的直接在github上看,旧的可能不好找。
在这里插入图片描述

git clone https://github.com/prometheus-operator/kube-prometheus.git
git checkout release-0.6 # 上面的兼容性说明
kubectl create -f manifests/setup
kubectl create -f manifests #完成安装
kubectl --namespace monitoring port-forward svc/prometheus-k8s 9090  ## Prometheus
kubectl --namespace monitoring port-forward svc/grafana 3000  ## Grafana
http://localhost:9090
http://localhost:3000

执行上面的命令,完成了就到这吧
3、安装prometheus

# 添加prometheus helm仓库
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
# 在monitoring下面安装prometheus
kubectl create ns monitoring
helm install prometheus prometheus-community/prometheus -n monitoring
# 暴露服务
kubectl expose service prometheus-server --type=NodePort --target-port=9090 --name=prometheus-server-np -n monitoring
# 访问服务<
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值