当前位置: 首页 > 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.agseo.cn/news/512/

相关文章:

  • windows将服务器文件夹映射到windows本地
  • assert 调试断言用法详解
  • [huggingface] huggingface 有和 `git clone` 一样方便的命令
  • 基础操作指令
  • buildroot 工具使用问题
  • 计数杂题选刷 Part II
  • 泛型
  • general planning
  • PHP反序列化漏洞-初学1
  • 2025.9.8 树套树
  • Rust异步运行时最小实现 - extreme 分享
  • 复健。(11~20,OI)
  • 诗-春江花月夜
  • MIDI简谱编辑器1.1程序代码QZQ-2025-8-20
  • MIDI简谱播放器1.1程序代码QZQ-2025-8-20
  • python语言网页版MIDI钢琴软件代码QZQ
  • 【2024-2025第二学期】助教工作学期总结(算法与数据结构)
  • p型编码
  • 赣江游记
  • OTA 升级问题的分析
  • 初识Dataset
  • Day15可变参数
  • Nacos
  • 单词的长度
  • Python模块之 subprocess 具有可访问I/O流的子流程 子进程管理
  • 因爱而……(和谐版)
  • 初探CTF
  • P3195 [HNOI2008] 玩具装箱
  • Python模块之execjs
  • 模拟题