feat: CoreServices | move into separate stack

This commit is contained in:
2025-11-22 19:30:09 +05:00
parent 1671f9619c
commit f46833571c
10 changed files with 101 additions and 118 deletions

View File

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

View File

@@ -0,0 +1,28 @@
ingress:
ingressClass:
enabled: true
isDefaultClass: false
name: traefik
deployment:
replicas: 3
podLabels:
app: traefik
nodeSelector:
nodepool: worker
topologySpreadConstraints:
- maxSkew: 1
topologyKey: "kubernetes.io/hostname"
whenUnsatisfiable: "ScheduleAnyway"
labelSelector:
matchLabels:
app: traefik
additionalArguments:
- "--entryPoints.ssh.address=:22/tcp"
ports:
ssh:
name: ssh
port: 22
exposedPort: 22
expose:
default: true
protocol: TCP