feat: CDKTF | migrate nginx ingress to cdktf
This commit is contained in:
28
nginx/index.ts
Normal file
28
nginx/index.ts
Normal 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 NginxOptions = {
|
||||
provider: HelmProvider;
|
||||
name: string;
|
||||
namespace: string;
|
||||
};
|
||||
|
||||
export class Nginx extends Construct {
|
||||
constructor(scope: Construct, id: string, options: NginxOptions) {
|
||||
super(scope, id);
|
||||
|
||||
new Release(this, id, {
|
||||
...options,
|
||||
repository: "https://kubernetes.github.io/ingress-nginx",
|
||||
chart: "ingress-nginx",
|
||||
createNamespace: true,
|
||||
values: [
|
||||
fs.readFileSync("helm/values/nginx-internal.values.yaml", {
|
||||
encoding: "utf8",
|
||||
}),
|
||||
],
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user