-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgcp-pach.ts
More file actions
76 lines (62 loc) · 2.46 KB
/
Copy pathgcp-pach.ts
File metadata and controls
76 lines (62 loc) · 2.46 KB
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 k8s from "@pulumi/kubernetes";
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
import { Address } from "@pulumi/gcp/compute";
/*
What's the minimum amount of data to pass in?
Other resources
CloudSql Database (optional)
Bucket
Static IP Address?
DNS? (Optional)
License Key
Kubeconfig
TLS
OIDC?
*/
class GCPPach extends pulumi.ComponentResource {
constructor(name: string, args: { enterpriseLisenseKey: pulumi.Input<string> }, opts?: pulumi.ComponentResourceOptions) {
super("pachyderm:index:instance", name, args, opts);
const bucket = new gcp.storage.Bucket(`${name}-bucket`, { location: "US", forceDestroy: true },{ parent: this } );
const ip = new gcp.compute.Address(`${name}-static`, {}, { parent: this });
const ns = new k8s.core.v1.Namespace(`${name}-pach`, { metadata: { name } }, { parent: this } );
const helmRelease = this.constructHelmRelease(name, args.enterpriseLisenseKey, ns, ip, bucket );
// Create a property for the bucket name that was created
//this.bucketName = siteBucket.bucket,
// Register that we are done constructing the component
this.registerOutputs({
pachIp: ip.address,
})
}
private constructHelmRelease(name: string, enterpriseLicenseKey: pulumi.Input<string>, ns: k8s.core.v1.Namespace, ip: gcp.compute.Address, bucket: gcp.storage.Bucket): k8s.helm.v3.Release {
return new k8s.helm.v3.Release(
"pach-release",
{
chart: "pachyderm",
namespace: ns.metadata.name,
repositoryOpts: {
repo: "https://pachyderm.github.io/helmchart",
},
values: {
proxy: {
enabled: true,
host: ip.address,
service: {
type: "LoadBalancer",
loadBalancerIP: ip.address,
},
},
pachd: {
enterpriseLicenseKey,
storage: {
google: {
bucket: bucket.name,
},
},
},
deployTarget: "GOOGLE",
},
}, { parent: this, dependsOn: [ns, ip, bucket]});
}
}
export default GCPPach;