helm部署vmalert
先决条件
安装以下软件包:git, kubectl, helm, helm-docs,请参阅本教程。
在 CentOS 上启用 snap 并安装 helm
启用 snapd
- 使用以下命令将 EPEL 存储库添加到您的系统中:
sudo yum install epel-release
- 按如下方式安装 Snap:
sudo yum install snapd
- 安装后,需要启用管理主 snap 通信套接字 的systemd单元:
sudo systemctl enable --now snapd.socket
- 创建软链/snap:
sudo ln -s /var/lib/snapd/snap /snap
- 注销并重新登录,或重新启动系统,以确保正确更新 snap 的路径。
安装 helm
使用以下命令安装 helm:
sudo snap install helm --classic
安装victoria-metrics-alert
- 使用以下命令添加图表 helm 存储库:
helm repo add vm https://victoriametrics.github.io/helm-charts/helm repo update
- 列出vm/victoria-metrics-alert可供安装的helm版本:
helm search repo vm/victoria-metrics-alert -l
- victoria-metrics-alert将图表的默认值导出到文件values.yaml:
helm show values vm/victoria-metrics-alert > values.yaml
根据环境需要更改values.yaml文件中的值。
[root@bastion ~]# cat values.yaml
# Default values for victoria-metrics-alert.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.serviceAccount:# Specifies whether a service account should be createdcreate: true# Annotations to add to the service accountannotations: {}# The name of the service account to use.# If not set and create is true, a name is generated using the fullname templatename:# mount API token to pod directlyautomountToken: trueimagePullSecrets: []rbac:create: truepspEnabled: truenamespaced: falseextraLabels: {}annotations: {}server:name: serverenabled: trueimage:repository: victoriametrics/vmalerttag: "" # rewrites Chart.AppVersionpullPolicy: IfNotPresentnameOverride: ""fullnameOverride: ""## See `kubectl explain poddisruptionbudget.spec` for more## ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb/podDisruptionBudget:enabled: false# minAvailable: 1# maxUnavailable: 1labels: {}# -- Additional environment variables (ex.: secret tokens, flags) https://github.com/VictoriaMetrics/VictoriaMetrics#environment-variablesenv:[]# - name: VM_remoteWrite_basicAuth_password# valueFrom:# secretKeyRef:# name: auth_secret# key: passwordreplicaCount: 1# deployment strategy, set to standard k8s defaultstrategy:type: RollingUpdaterollingUpdate:maxSurge: 25%maxUnavailable: 25%# specifies the minimum number of seconds for which a newly created Pod should be ready without any of its containers crashing/terminating# 0 is the standard k8s defaultminReadySeconds: 0# vmalert reads metrics from source, next section represents its configuration. It can be any service which supports# MetricsQL or PromQL.datasource:url: "http://192.168.47.9:8481/select/0/prometheus/"basicAuth:username: ""password: ""remote:write:url: ""read:url: ""notifier:alertmanager:url: "http://192.168.112.68:9093"extraArgs:envflag.enable: "true"envflag.prefix: VM_loggerFormat: json# Additional hostPath mountsextraHostPathMounts:[]# - name: certs-dir# mountPath: /etc/kubernetes/certs# subPath: ""# hostPath: /etc/kubernetes/certs# readOnly: true# Extra Volumes for the podextraVolumes:[]#- name: example# configMap:# name: example# Extra Volume Mounts for the containerextraVolumeMounts:[]# - name: example# mountPath: /exampleextraContainers:[]#- name: config-reloader# image: reloader-imageservice:annotations: {}labels: {}clusterIP: ""## Ref: https://kubernetes.io/docs/user-guide/services/#external-ips##externalIPs: []loadBalancerIP: ""loadBalancerSourceRanges: []servicePort: 8880type: ClusterIP# Ref: https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip# externalTrafficPolicy: "local"# healthCheckNodePort: 0ingress:enabled: falseannotations: {}# kubernetes.io/ingress.class: nginx# kubernetes.io/tls-acme: 'true'extraLabels: {}hosts: []# - name: vmselect.local# path: /select# port: httptls: []# - secretName: vmselect-ingress-tls# hosts:# - vmselect.local# For Kubernetes >= 1.18 you should specify the ingress-controller via the field ingressClassName# See https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/#specifying-the-class-of-an-ingress# ingressClassName: nginx# -- pathType is only for k8s >= 1.1=pathType: PrefixpodSecurityContext: {}# fsGroup: 2000securityContext:{}# capabilities:# drop:# - ALL# readOnlyRootFilesystem: true# runAsNonRoot: true# runAsUser: 1000resources:{}# We usually recommend not to specify default resources and to leave this as a conscious# choice for the user. This also increases chances charts run on environments with little# resources, such as Minikube. If you do want to specify resources, uncomment the following# lines, adjust them as necessary, and remove the curly braces after 'resources:'.# limits:# cpu: 100m# memory: 128Mi# requests:# cpu: 100m# memory: 128Mi# Annotations to be added to the deploymentannotations: {}# labels to be added to the deploymentlabels: {}# Annotations to be added to podpodAnnotations: {}podLabels: {}nodeSelector: {}priorityClassName: ""tolerations: []affinity: {}# vmalert alert rules configuration configuration:# use existing configmap if specified# otherwise .config values will be usedconfigMap: ""config:alerts:groups:- name: 主机状态rules:- alert: 主机状态expr: up == 0for: 1mlabels:status: warningannotations:summary: "{{$labels.instance}}:服务器关闭"description: "{{$labels.instance}}:服务器关闭"serviceMonitor:enabled: falseextraLabels: {}annotations: {}
# interval: 15s
# scrapeTimeout: 5s# -- Commented. HTTP scheme to use for scraping.
# scheme: https# -- Commented. TLS configuration to use when scraping the endpoint
# tlsConfig:
# insecureSkipVerify: truealertmanager:enabled: truereplicaCount: 1podMetadata:labels: {}annotations: {}image: prom/alertmanagertag: v0.20.0retention: 120hnodeSelector: {}priorityClassName: ""resources: {}tolerations: []imagePullSecrets: []podSecurityContext: {}extraArgs: {}# key: value# external URL, that alertmanager will expose to receiversbaseURL: ""# use existing configmap if specified# otherwise .config values will be usedconfigMap: ""config:global:resolve_timeout: 5mroute:# default receiverreceiver: ops_notify# tag to group bygroup_by: ["alertname"]# How long to initially wait to send a notification for a group of alertsgroup_wait: 30s# How long to wait before sending a notification about new alerts that are added to a groupgroup_interval: 10s# How long to wait before sending a notification again if it has already been sent successfully for an alertrepeat_interval: 1hreceivers:- name: ops_notifywebhook_configs:- url: http://localhost:8060/dingtalk/webhook1/sendsend_resolved: truetemplates: {}# alertmanager.tmpl: |-service:annotations: {}type: ClusterIPport: 9093# if you want to force a specific nodePort. Must be use with service.type=NodePort# nodePort:ingress:enabled: falseannotations: {}# kubernetes.io/ingress.class: nginx# kubernetes.io/tls-acme: 'true'extraLabels: {}hosts: []# - name: alertmanager.local# path: /# port: webtls: []# - secretName: alertmanager-ingress-tls# hosts:# - alertmanager.local# For Kubernetes >= 1.18 you should specify the ingress-controller via the field ingressClassName# See https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/#specifying-the-class-of-an-ingress# ingressClassName: nginx# -- pathType is only for k8s >= 1.1=pathType: PrefixpersistentVolume:# -- Create/use Persistent Volume Claim for alertmanager component. Empty dir if falseenabled: false# -- Array of access modes. Must match those of existing PV or dynamic provisioner. Ref: [http://kubernetes.io/docs/user-guide/persistent-volumes/](http://kubernetes.io/docs/user-guide/persistent-volumes/)accessModes:- ReadWriteOnce# -- Persistant volume annotationsannotations: {}# -- StorageClass to use for persistent volume. Requires alertmanager.persistentVolume.enabled: true. If defined, PVC created automaticallystorageClass: ""# -- Existing Claim name. If defined, PVC must be created manually before volume will be boundexistingClaim: ""# -- Mount path. Alertmanager data Persistent Volume mount root path.mountPath: /data# -- Mount subpathsubPath: ""# -- Size of the volume. Better to set the same as resource limit memory property.size: 50Mi



- 使用命令测试安装:
helm install vmalert vm/victoria-metrics-alert -f values.yaml -n NAMESPACE --debug --dry-run
- 使用以下命令安装
helm install vmalert vm/victoria-metrics-alert -f values.yaml -n NAMESPACE
- 通过运行以下命令获取 pod 列表:
kubectl get pods -A | grep 'alert'
- 通过运行以下命令获取应用程序:
helm list -f vmalert -n NAMESPACE
- 使用命令查看应用程序版本的历史记录vmalert:
helm history vmalert -n NAMESPACE
参考文档:https://github.com/VictoriaMetrics/helm-charts/tree/master/charts/victoria-metrics-alert
参考文档:https://snapcraft.io/install/helm/centos#install
相关文章:
helm部署vmalert
先决条件 安装以下软件包:git, kubectl, helm, helm-docs,请参阅本教程。 在 CentOS 上启用 snap 并安装 helm 启用 snapd 使用以下命令将 EPEL 存储库添加到您的系统中: sudo yum install epel-release 按如下方式安装 Snap࿱…...
加工厂数字孪生3D可视化展示系统重塑管理模式
近年来“数字化转型”成立各行业聚焦的发展方向,在工业制造领域,智慧工业数字孪生可视化平台作为一种新型的技术手段,或将成为助力企业跑赢数字化转型最后一公里。 提高生产效率 传统的生产方式往往需要大量的人工干预,不仅耗时耗…...
php从静态资源到动态内容
1、从HTML到PHP demo.php:后缀由html直接改为php,实际上当前页面已经变成了动态的php应用程序脚本 demo.php: 允许通过<?php ... ?>标签,添加php代码到当前脚本中 php标签内部代码由php.exe解释, php标签之外的代码原样输出,仍由web服务器解析 <!DOCTYPE html>…...
JavaScript:模块化【CommonJS与ES6】
在 JavaScript 编程中,随着项目的复杂性增加,代码的组织和管理变得至关重要。模块化是一种强大的编程概念,它允许我们将代码划分为独立的模块,提高了可维护性和可扩展性。本文将详细介绍 CommonJS 和 ES6 模块,帮助你理…...
Redis—持久化
这里写目录标题 AOF三种写回策略写回策略的优缺点AOF 重写机制AOF后台重写AOF优缺点使用命令 RDBRDB 持久化的工作原理执行快照时,数据能被修改吗RDB 持久化的优点RDB 持久化的缺点 混合持久化大key对持久化的影响 AOF 保存写操作命令到日志的持久化方式࿰…...
【设计模式】代理模式
在代理模式(Proxy Pattern)中,一个类代表另一个类的功能。这种类型的设计模式属于结构型模式。 在代理模式中,我们创建具有现有对象的对象,以便向外界提供功能接口。 介绍 意图:为其他对象提供一种代理以…...
mac arm 通过brew搭建 php+nginx+mysql+xdebug
1.安装nginx brew install nginx //安装brew services start nginx //启动2.安装php brew install php7.4 //安装export PATH"/opt/homebrew/opt/php7.4/bin:$PATH" //加入环境变量 export PATH"/opt/homebrew/opt/php7.4/sbin:$PATH"brew serv…...
软信天成:告别手动编码,实现智能自动化云数据管理
数字化转型浪潮之下,各个企业都在大力投资新的基于云的流程、平台和环境,以期获取可扩展性、弹性、敏捷性和成本效益等优势。 这些趋势要求企业IT部门能够帮助组织,在对分析进行现代化改造的过程中达到云就绪或云优先状态。事实上࿰…...
易基因:ChIP-seq等揭示转录因子NRF1调控原始生殖细胞发育、增殖和存活的表观遗传机制|科研进展
大家好,这里是专注表观组学十余年,领跑多组学科研服务的易基因。 原始生殖细胞(Primordial germ cell,PGC)是生殖细胞前体,可以产生卵母细胞和精子,确保生命延续。尽管PGC特化(PGC …...
35岁,体能断崖?你需要健康的生活习惯
大厂裁员,称35岁以后体能下滑,无法继续高效率地完成工作;体重上涨,因为35岁以后新陈代谢开始变慢;甚至坐久了会腰疼、睡眠困扰开始加重,在众多的归因中,35岁的到来,为一切的焦虑埋下…...
mysql 习题总结
1.select sex,avg(salsry) as 平均薪资 from emp group by sex; 2.select depart,sum(salsry) from emp group by depart; 3.select depart ,sum(salary) from emp group by depart order by sum(salary) desc limit 1,1; 4.select name from emp group by name having count(n…...
IL汇编语言做一个窗体
网上看到一段代码, .assembly extern mscorlib {} .assembly Classes { .ver 1:0:1:0 } .namespace MyForm { .class public TestForm extends [System.Windows.Forms]System.Windows.Forms.Form { .field private class [System]…...
不用技术代码,分班查询系统怎么做?
暑假即将结束,新学期开始将面临分班信息公布的工作!对于分班信息公布,涉及到学生的个人信息,包括姓名、学号、班级等。在发布这些信息时,必须确保数据的保密性,防止未经授权的人员获取到学生的个人信息。因…...
【Mybatis】调试查看执行的 SQL 语句
1. 问题场景: 记录日常开发过程中 Mybatis 调试 SQL 语句,想要查看Mybatis 中执行的 SQL语句,导致定位问题困难 2. 解决方式 双击shift找到mybatis源码中的 MappedStatement的getBoundSql()方法 public BoundSql getBoundSql(Object para…...
【多视重建】从Zero-123到One-2-3-45:多视角生成
文章目录 摘要一、引言二、相关工作三、Zero-1-to-33.1.学习如何控制照相机的视角3.2.视角作为条件的扩散3.3三维重构3.4 数据集 四、One-2-3-454.1 Zero123: 视角条件的 2D Diffusion4.2 NeRF优化:将多视图预测提升到三维图像4.3 基于不完美多视图的 神经表面重建*…...
(四)Unity开发Vision Pro——参考文档
4.参考文档 4.1 支持的功能和组件 4.1.1 支持的 Unity 功能和组件 大多数 Unity 组件无需修改即可在此平台上运行 - 包括大多数自定义 MonoBehaviours、动画逻辑、物理、输入处理、资产管理、AI 等。然而,需要渲染的组件需要特殊的支持。因此,一些组件…...
【Linux】简单线程池的设计与实现 -- 单例模式
前言对锁的封装整体代码LockGuard - RALLRALLMutex封装 对线程创建的封装整体代码成员函数解释声明 业务处理封装-加减乘除(可有可无)整体代码成员函数解释声明 线程池的设计与实现整体代码成员函数解释声明 展示 前言 线程池: 一种线程使用模式。线程过…...
[RoarCTF 2019Online Proxy]sql巧妙盲注
文章目录 [RoarCTF 2019Online Proxy]sql巧妙盲注解题脚本脚本解析 [RoarCTF 2019Online Proxy]sql巧妙盲注 解题 在源代码界面发现:Current Ip 我们会联想到:X-Forwarded-For来修改ip: 结果我们发现,response会讲Last Ip回显出…...
flutter开发实战-just_audio实现播放音频暂停音频设置音量等
flutter开发实战-just_audio实现播放音频暂停音频设置音量等 最近开发过程中遇到需要播放背景音等音频播放,这里使用just_audio来实现播放音频暂停音频设置音量等 一、引入just_audio 在pubspec.yaml引入just_audio just_audio: ^2.7.0在iOS上,video_p…...
【Bert101】最先进的 NLP 模型解释【01/4】
0 什么是伯特? BERT是来自【Bidirectional Encoder Representations from Transformers】变压器的双向编码器表示的缩写,是用于自然语言处理的机器学习(ML)模型。它由Google AI Language的研究人员于2018年开发,可作为…...
雪女-斗罗大陆-造相Z-Turbo在元宇宙中的应用:为用户虚拟化身生成个性化动漫形象
雪女-斗罗大陆-造相Z-Turbo在元宇宙中的应用:为用户虚拟化身生成个性化动漫形象 想象一下,你正准备进入一个热闹的虚拟世界,参加一场线上聚会。别人都顶着一个系统默认的、千篇一律的方块人形象,而你,却拥有一个完全根…...
Phi-3-mini-4k-instruct-gguf企业实操:HR部门员工制度问答机器人快速上线
Phi-3-mini-4k-instruct-gguf企业实操:HR部门员工制度问答机器人快速上线 1. 项目背景与价值 HR部门每天都会收到大量关于员工制度的咨询,从考勤规则到福利政策,重复性问题占据了大量工作时间。传统的人工回复方式效率低下,且难…...
保姆级教程:在Ubuntu 22.04上,用Chroot和xorriso定制你的专属服务器镜像(附离线包集成)
深度实战:Ubuntu 22.04离线镜像定制全流程解析 当你需要在隔离网络环境中批量部署数十台服务器时,每次手动配置无疑是一场噩梦。想象一下:每次部署都要重复安装相同的软件包、配置相同的系统参数、解决相同的依赖问题——这不仅效率低下&…...
SIwave TDR仿真实战:从模型导入到阻抗结果深度解析
1. SIwave TDR仿真基础与实战价值 TDR(时域反射计)仿真是高速电路设计中不可或缺的验证手段。我第一次接触SIwave的TDR功能是在一个10Gbps SerDes链路项目中,当时遇到了信号完整性问题却苦于找不到准确的阻抗突变点。传统频域仿真虽然能给出S…...
ESP-IDF项目中的CMakeLists.txt配置:如何高效管理.c和.h文件
1. 为什么需要高效管理.c和.h文件 在ESP-IDF项目中,随着功能模块不断增加,代码文件会越来越多。想象一下,如果你的项目里有几十个.c文件和对应的.h文件,每次新增或修改文件都要手动调整编译配置,那简直是场噩梦。我刚开…...
mysql执行预处理语句流程是怎样的_SQL执行优化解析
预处理语句生命周期为PREPARE→EXECUTE→DEALLOCATE三阶段,执行计划在EXECUTE时生成且不跨连接复用;参数类型影响索引选择与优化效果;仅支持值占位,不支持动态表名/列名;PHP PDO默认模拟预处理会失效原生优化。预处理语…...
C# 实现异步非阻塞式定时关闭消息弹窗
1. 为什么需要异步非阻塞式消息弹窗 在日常开发中,MessageBox.Show()可能是我们最先接触到的弹窗方式。但用过几次就会发现,这个看似方便的方法存在两个致命缺陷:一是必须等待用户点击确认按钮,二是会阻塞当前线程的执行。想象一下…...
AI医学影像领域标杆推荐:德适
医学影像作为AI落地最成熟、临床价值最明确的赛道,正迎来从单点工具向通用大模型跃迁的关键阶段。德适以自主可控的底层技术、深度贴合临床的产品矩阵与规模化商业兑现能力,成为2026年AI医学影像领域最值得重点关注的标杆企业。 德适是国家级专精特新“小…...
OpenClaw学习总结_IV_认证与安全_4:Multi-Account Patterns详解
OpenClaw IV. 认证与安全(4)Multi-Account Patterns本篇目标:把“一个人/一个团队同时拥有多个账号(或多个 Bot / 多个 Workspace / 多个 Provider credentials)”时,OpenClaw 侧应该怎么建模、怎么隔离、怎…...
ESP8266轻量MQTT Broker:零依赖离线直连实现
1. 项目概述MQTTbroker 是一款专为 ESP8266 设计的轻量级嵌入式 MQTT 消息代理(Broker)实现,其核心目标是构建一个零依赖、离线可用、端到端直连的物联网本地通信枢纽。它并非传统意义上的全功能云级 Broker(如 Mosquitto 或 EMQX…...
