feat: CDKTF | migrate authentik to cdktf
This commit is contained in:
29
authentik/index.ts
Normal file
29
authentik/index.ts
Normal 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",
|
||||
}),
|
||||
],
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -11,8 +11,6 @@ repositories:
|
||||
url: https://charts.jetstack.io
|
||||
- name: prometheus-community
|
||||
url: https://prometheus-community.github.io/helm-charts
|
||||
- name: authentik
|
||||
url: https://charts.goauthentik.io
|
||||
---
|
||||
releases:
|
||||
# Load Balancer
|
||||
@@ -76,11 +74,3 @@ releases:
|
||||
version: 20.2.0
|
||||
values:
|
||||
- ./values/redis.values.yaml
|
||||
|
||||
# Authentik
|
||||
- name: authentik
|
||||
namespace: authentik-system
|
||||
chart: authentik/authentik
|
||||
version: 2024.10.5
|
||||
values:
|
||||
- ./values/authentik.values.yaml
|
||||
|
||||
8
main.ts
8
main.ts
@@ -9,6 +9,7 @@ import { GiteaServer } from "./gitea";
|
||||
import { OnePassword } from "./1password";
|
||||
import { PostgresCluster } from "./postgres";
|
||||
import { Longhorn } from "./longhorn";
|
||||
import { AuthentikServer } from "./authentik";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
@@ -56,6 +57,13 @@ class Homelab extends TerraformStack {
|
||||
initSecretName: "postgres-password",
|
||||
});
|
||||
|
||||
new AuthentikServer(this, "authentik-server", {
|
||||
provider: helm,
|
||||
name: "authentik",
|
||||
namespace: "authentik-system",
|
||||
version: "2024.10.5",
|
||||
});
|
||||
|
||||
new GiteaServer(this, "gitea-server", {
|
||||
name: "gitea",
|
||||
namespace: "gitea-system",
|
||||
|
||||
Reference in New Issue
Block a user