当前位置: 首页 > news >正文

helm 部署 prometheus

1、拉取helm charts

helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update
helm search repo prometheus-community --versions            # 选你想要的版本
helm pull prometheus-community/kube-prometheus-stack --version 75.18.1 --untar

2、修改values文件

# values.yamlextraArgs:web.external-url: "http://prometheus.xwk.local"       # Prometheus内部感知的对外访问URL,一定要添加不要漏了
···ingress:enabled: true           # 开启ingressClassName: "traefik"     # 改为自己的ingress类
···hosts:- prometheus.xwk.local         # 添加访问地址
···persistentVolume:enabled: truestorageClass: "nfs-data"       # 添加存储类
···
alertmanager:## If false, alertmanager will not be installed##enabled: truepersistence:size: 2GipodSecurityContext:runAsUser: 65534runAsNonRoot: truerunAsGroup: 65534fsGroup: 65534persistence:                  # 这个是原来values中没有的,需要自己添加进去,不然storage-prometheus-alertmanager-0会处于pending状态enabled: truestorageClass: "nfs-data"accessModes:- ReadWriteOncesize: 2Gi# 安装
[root@master-11 prometheus]# helm install -n prometheus prometheus -f values.yaml .
Release "prometheus" has been install. Happy Helming!
NAME: prometheus
LAST DEPLOYED: Fri Sep  5 23:54:49 2025
NAMESPACE: prometheus
STATUS: deployed
REVISION: 7
TEST SUITE: None
NOTES:
The Prometheus server can be accessed via port 80 on the following DNS name from within your cluster:
prometheus-server.prometheus.svc.cluster.localFor access from outside the cluster, the server URL(s) are:
http://prometheus.xwk.localThe Prometheus alertmanager can be accessed via port 9093 on the following DNS name from within your cluster:
prometheus-alertmanager.prometheus.svc.cluster.localGet the Alertmanager URL by running these commands in the same shell:export POD_NAME=$(kubectl get pods --namespace prometheus -l "app.kubernetes.io/name=alertmanager,app.kubernetes.io/instance=prometheus" -o jsonpath="{.items[0].metadata.name}")kubectl --namespace prometheus port-forward $POD_NAME 9093
#################################################################################
######   WARNING: Pod Security Policy has been disabled by default since    #####
######            it deprecated after k8s 1.25+. use                        #####
######            (index .Values "prometheus-node-exporter" "rbac"          #####
###### .          "pspEnabled") with (index .Values                         #####
######            "prometheus-node-exporter" "rbac" "pspAnnotations")       #####
######            in case you still need it.                                #####
#################################################################################The Prometheus PushGateway can be accessed via port 9091 on the following DNS name from within your cluster:
prometheus-prometheus-pushgateway.prometheus.svc.cluster.localGet the PushGateway URL by running these commands in the same shell:export POD_NAME=$(kubectl get pods --namespace prometheus -l "app=prometheus-pushgateway,component=pushgateway" -o jsonpath="{.items[0].metadata.name}")kubectl --namespace prometheus port-forward $POD_NAME 9091For more information on running Prometheus, visit:
https://prometheus.io/[root@master-11 ~]# kubectl get pods -n prometheus
NAME                                                 READY   STATUS    RESTARTS   AGE
prometheus-alertmanager-0                            1/1     Running   0          64m
prometheus-kube-state-metrics-65d678f66d-jzlgc       1/1     Running   0          71m
prometheus-prometheus-node-exporter-jwvvb            1/1     Running   0          71m
prometheus-prometheus-node-exporter-kfc7r            1/1     Running   0          71m
prometheus-prometheus-node-exporter-s5ljx            1/1     Running   0          71m
prometheus-prometheus-pushgateway-85f676f677-sdl95   1/1     Running   0          71m
prometheus-server-7599c98758-vxrlp                   2/2     Running   0          29m# 访问web页面
添加hosts解析后访问http://prometheus.xwk.local/

29f63948-d2aa-4d7a-8ee2-beef5b6a1fa4
c0713e74-d798-45db-87f0-f788358cd945

http://www.gsyq.cn/news/439.html

相关文章:

  • assert 调试断言用法详解
  • 2025.9.8 树套树
  • 复健。(11~20,OI)
  • MIDI简谱播放器1.1程序代码QZQ-2025-8-20
  • python语言网页版MIDI钢琴软件代码QZQ
  • 初识Dataset
  • Day15可变参数
  • 单词的长度
  • 111
  • LIN 的调度表周期和应用任务周期不一致的问题分析
  • 关于我的大三生活
  • 厨房小白学做饭——2.苦瓜炒蛋
  • GJOJ 9/6
  • CF1967D Long Way to be Non-decreasing
  • Proximal SFT:用PPO强化学习机制优化SFT,让大模型训练更稳定
  • 解题报告-洛谷P3773 [CTSC2017] 吉夫特
  • 政治笔记
  • Graspnet视觉抓取(一)——环境搭建
  • 3. 堆排序
  • 总结
  • 【Azure Container App】查看当前 Container App Environment 中的 CPU 使用情况的API
  • TTS微软Azure
  • 解决docker: Error response from daemon: Get “https://registry-1.docker.io/v2/“:连接超时问题
  • 27届春招备战一轮复习--第三期(推荐)
  • 三期集训 日记?
  • 需求爆炸?领歌3步科学精简法,让团队重获掌控力!
  • 在服务器后台运行python服务
  • HCIP回顾—2 OSPF工作过程及状态机制
  • 实时通信的头痛-问题不在WebSocket而是你的框架
  • 你的开发服务器在说谎-热重载与热重启的关键区别