diff --git a/automation/generate-scrape-config.py b/automation/generate-scrape-config.py index 72e2873..9e4df7d 100644 --- a/automation/generate-scrape-config.py +++ b/automation/generate-scrape-config.py @@ -42,12 +42,27 @@ def write_scrape_config(jobs): ] }) + secret = { + "apiVersion": "v1", + "kind": "Secret", + "metadata": { + "name": "prometheus-additional-scrape-configs", + "namespace": "monitoring", + "labels": { + "app.kubernetes.io/name": "prometheus" + } + }, + "type": "Opaque", + "stringData": { + "additional-scrape-configs.yaml": "# This content will be auto-updated by the pipeline\n" + yaml.dump(result) + } + } + os.makedirs(os.path.dirname(OUTPUT_FILE), exist_ok=True) with open(OUTPUT_FILE, "w") as f: - yaml.dump(result, f) + yaml.dump(secret, f) if __name__ == "__main__": jobs = collect_targets() write_scrape_config(jobs) print(f"✅ Generated: {OUTPUT_FILE}") -