29 lines
756 B
TypeScript
29 lines
756 B
TypeScript
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",
|
|
}),
|
|
],
|
|
});
|
|
}
|
|
}
|