feat: organize all services into separate stacks by dependency

This commit is contained in:
2025-11-22 17:51:58 +05:00
parent 06a316f1e6
commit a25c25afc4
30 changed files with 2513 additions and 386 deletions

42
k8s-operators/barman.ts Normal file
View File

@@ -0,0 +1,42 @@
import { Construct } from "constructs";
import { NullProvider } from "@cdktf/provider-null/lib/provider";
import { Resource } from "@cdktf/provider-null/lib/resource";
export interface BarmanCloudPluginInstallOptions {
/** URL to the CloudNativePG barman-cloud plugin manifest */
url: string;
}
export class BarmanCloudPluginInstall extends Construct {
constructor(
scope: Construct,
id: string,
opts: BarmanCloudPluginInstallOptions,
) {
super(scope, id);
const { url } = opts;
const applyCmd = ["kubectl", "apply", "-f", url].join(" ");
const deleteCmd = ["kubectl", "delete", "-f", url].join(" ");
new Resource(this, "barman-install", {
provider: new NullProvider(this, "barman"),
provisioners: [
{
type: "local-exec",
when: "create",
command: applyCmd,
},
{
type: "local-exec",
when: "destroy",
command: deleteCmd,
},
],
triggers: {
url,
},
});
}
}