-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlonghorn.ts
54 lines (48 loc) · 1.37 KB
/
longhorn.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
import * as pulumi from "@pulumi/pulumi";
import * as k8s from "@pulumi/kubernetes";
export type LonghornOptions = {
provider: k8s.Provider;
issuer: k8s.apiextensions.CustomResource;
host: string;
};
const pulumiComponentNamespace: string = "turingev:Longhorn";
export class Longhorn extends pulumi.ComponentResource {
public readonly chart: k8s.helm.v3.Release;
public readonly namespace: k8s.core.v1.Namespace;
constructor(
name: string,
args: LonghornOptions,
opts?: pulumi.ComponentResourceOptions,
) {
super(pulumiComponentNamespace, name, args, opts);
this.namespace = new k8s.core.v1.Namespace(
"longhorn-system",
{
metadata: { name: "longhorn-system" },
},
{ provider: args.provider, parent: this },
);
this.chart = new k8s.helm.v3.Release(
name,
{
chart: "longhorn",
namespace: this.namespace.metadata.name,
repositoryOpts: {
repo: "https://charts.longhorn.io",
},
values: {
ingress: {
enabled: true,
host: args.host,
tls:`${args.host}-cert`,
annotations: {
"cert-manager.io/cluster-issuer": args.issuer.metadata.name,
},
},
},
version: "1.5.1",
},
{ dependsOn: this.namespace, provider: args.provider, parent: this },
);
}
}