-
Notifications
You must be signed in to change notification settings - Fork 0
/
mailu.ts
67 lines (60 loc) · 1.77 KB
/
mailu.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import * as pulumi from "@pulumi/pulumi";
import * as k8s from "@pulumi/kubernetes";
export type MailuOptions = {
provider: k8s.Provider;
domain: string;
initialAccount?: {
domain?: string;
username?: string;
password?: string;
};
namespaceName: string;
};
const pulumiComponentNamespace: string = "turingev:Mailu";
export class Mailu extends pulumi.ComponentResource {
provider: k8s.Provider;
constructor(name, args: MailuOptions, opts) {
super(pulumiComponentNamespace, name, {}, opts);
const mailuNamespace = new k8s.core.v1.Namespace(
args.namespaceName,
{
metadata: { name: args.namespaceName },
},
{ dependsOn: args.provider, provider: args.provider, parent: this },
);
const mailuChart = new k8s.helm.v3.Release(
name,
{
chart: "mailu",
namespace: mailuNamespace.metadata.name,
repositoryOpts: {
repo: "https://mailu.github.io/helm-charts",
},
values: {
domain: args.domain,
hostnames: [args.domain],
initialAccount: {
domain: args.initialAccount?.domain ?? args.domain,
username: args.initialAccount?.username ?? "admin",
password: args.initialAccount?.password ?? "password",
},
logLevel: "INFO",
limits: {
authRatelimit: {
ip: "100/minute;3600/hour",
},
messageSizeLimitInMegabytes: 200,
},
persistence: {
size: "10Gi",
storageClass: "rancher.io/local-path",
},
secretKey: "chang3m3!",
},
version: "1.2.0",
},
{ dependsOn: mailuNamespace, provider: args.provider, parent: this },
);
this.registerOutputs();
}
}