feat: CDKTF | migrate prometheus into cdktf

This commit is contained in:
2025-07-15 12:22:55 +05:00
parent 4f15e8d65a
commit 81702fac64
3 changed files with 35 additions and 10 deletions

28
prometheus/index.ts Normal file
View File

@@ -0,0 +1,28 @@
import * as fs from "fs";
import { HelmProvider } from "@cdktf/provider-helm/lib/provider";
import { Release } from "@cdktf/provider-helm/lib/release";
import { Construct } from "constructs";
type PrometheusOptions = {
provider: HelmProvider;
name: string;
namespace: string;
};
export class Prometheus extends Construct {
constructor(scope: Construct, id: string, options: PrometheusOptions) {
super(scope, id);
new Release(this, id, {
...options,
repository: "https://prometheus-community.github.io/helm-charts",
chart: "kube-prometheus-stack",
createNamespace: true,
values: [
fs.readFileSync("helm/values/prometheus.values.yaml", {
encoding: "utf8",
}),
],
});
}
}