-
Notifications
You must be signed in to change notification settings - Fork 0
/
dashboard.ts
76 lines (69 loc) · 1.93 KB
/
dashboard.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
68
69
70
71
72
73
74
75
76
import * as pulumi from "@pulumi/pulumi";
import * as k8s from "@pulumi/kubernetes";
export type DashboardOptions = {
provider: k8s.Provider;
namespaceName: string;
issuer: k8s.apiextensions.CustomResource;
host: string;
};
const pulumiComponentNamespace: string = "turingev:Dashboard";
export class Dasboard extends pulumi.ComponentResource {
public readonly chart: k8s.helm.v3.Release;
public readonly namespace: k8s.core.v1.Namespace;
constructor(
name: string,
args: DashboardOptions,
opts?: pulumi.ComponentResourceOptions,
) {
super(pulumiComponentNamespace, name, args, opts);
this.namespace = new k8s.core.v1.Namespace(
args.namespaceName,
{
metadata: { name: args.namespaceName },
},
{ provider: args.provider, parent: this },
);
this.chart = new k8s.helm.v3.Release(
name,
{
chart: "kubernetes-dashboard",
namespace: this.namespace.metadata.name,
repositoryOpts: {
repo: "https://kubernetes.github.io/dashboard/",
},
values: {
ingress: {
enabled: true,
hosts: [args.host],
annotations: {
"cert-manager.io/cluster-issuer": args.issuer.metadata.name,
},
tls: [
{
secretName: `${args.host}-cert`,
hosts: [args.host],
},
],
},
protocolHttp: true,
service: {
externalPort: 80,
},
// for v3 major release
// issuer: {
// scope: "cluster",
// name: args.issuer.metadata.name,
// },
// nginx: {
// enabled: false,
// },
// "cert-manager": {
// enabled: false,
// },
},
version: "6.0.8",
},
{ dependsOn: this.namespace, provider: args.provider, parent: this },
);
}
}