feat: CDKTF | migrate authentik to cdktf

This commit is contained in:
2025-07-15 09:16:35 +05:00
parent 8afd079d5a
commit 3f6b8812da
3 changed files with 37 additions and 10 deletions

29
authentik/index.ts Normal file
View File

@@ -0,0 +1,29 @@
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 AuthentikServerOptions = {
provider: HelmProvider;
version: string;
name: string;
namespace: string;
};
export class AuthentikServer extends Construct {
constructor(scope: Construct, id: string, options: AuthentikServerOptions) {
super(scope, id);
new Release(this, id, {
...options,
repository: "https://charts.goauthentik.io",
chart: "authentik",
createNamespace: true,
values: [
fs.readFileSync("helm/values/authentik.values.yaml", {
encoding: "utf8",
}),
],
});
}
}

View File

@@ -11,8 +11,6 @@ repositories:
url: https://charts.jetstack.io url: https://charts.jetstack.io
- name: prometheus-community - name: prometheus-community
url: https://prometheus-community.github.io/helm-charts url: https://prometheus-community.github.io/helm-charts
- name: authentik
url: https://charts.goauthentik.io
--- ---
releases: releases:
# Load Balancer # Load Balancer
@@ -76,11 +74,3 @@ releases:
version: 20.2.0 version: 20.2.0
values: values:
- ./values/redis.values.yaml - ./values/redis.values.yaml
# Authentik
- name: authentik
namespace: authentik-system
chart: authentik/authentik
version: 2024.10.5
values:
- ./values/authentik.values.yaml

View File

@@ -9,6 +9,7 @@ import { GiteaServer } from "./gitea";
import { OnePassword } from "./1password"; import { OnePassword } from "./1password";
import { PostgresCluster } from "./postgres"; import { PostgresCluster } from "./postgres";
import { Longhorn } from "./longhorn"; import { Longhorn } from "./longhorn";
import { AuthentikServer } from "./authentik";
dotenv.config(); dotenv.config();
@@ -56,6 +57,13 @@ class Homelab extends TerraformStack {
initSecretName: "postgres-password", initSecretName: "postgres-password",
}); });
new AuthentikServer(this, "authentik-server", {
provider: helm,
name: "authentik",
namespace: "authentik-system",
version: "2024.10.5",
});
new GiteaServer(this, "gitea-server", { new GiteaServer(this, "gitea-server", {
name: "gitea", name: "gitea",
namespace: "gitea-system", namespace: "gitea-system",