Mercurial > code > home > repos > victoriametrics
view tasks.py @ 32:eb1de82c93aa
refactor the merging of all the groups
author | drewp@bigasterisk.com |
---|---|
date | Wed, 19 Jul 2023 21:28:10 -0700 |
parents | eec015e90818 |
children | 3b91d52b007d |
line wrap: on
line source
import yaml from invoke import task from kubernetes import config import alert_rules from k8s_ops import firstPodName, refreshPodCmaps, replaceCmap config.load_kube_config() @task def push_config(ctx): configObj = scrapeConfig(ctx) rulesObj = alert_rules.allRules(ctx) replaceCmap("victoriametrics-config", {"scrape_main": configObj, "rules": rulesObj}) refreshPodCmaps(firstPodName("app=victoriametrics")) refreshPodCmaps(firstPodName("app=vmalert")) # If the VM reloader isn't fast enough, we could do this too: # hup(ctx, 'deploy/victoriametrics', 'victoria-metrics-prod') def scrapeConfig(ctx): return yaml.load(open("config/scrape_main.yaml"), yaml.FullLoader)