-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ts
69 lines (57 loc) · 1.63 KB
/
index.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
import * as k8s from "@pulumi/kubernetes";
import * as pulumi from "@pulumi/pulumi";
import * as execution from "./clients/execution";
import * as consensus from "./clients/consensus";
import { Rocketpool } from "./rocketpool";
const config = new pulumi.Config();
const network = pulumi.getStack();
const kubeconfig =
config.get("kubeconfig") ||
new pulumi.StackReference("kubeconfig", {
name: "/rocketpool-cluster/gcp",
}).getOutput("kubeconfig");
const provider = new k8s.Provider("rocketpool-cluster", {
kubeconfig: kubeconfig,
namespace: network,
});
new k8s.core.v1.Namespace(
`${network}-namespace`,
{
metadata: {
name: network,
},
},
{ provider: provider }
);
const consensusList =
config.requireObject<[keyof typeof consensus.ClientClasses]>("consensus");
const executionList =
config.requireObject<[keyof typeof execution.ClientClasses]>("execution");
const executionClients: execution.AbstractClient[] = [];
const consensusClients: consensus.AbstractClient[] = [];
for (const executionClientName of executionList) {
const clientClass = execution.ClientClasses[executionClientName];
const client = clientClass.fromConfig(provider, network, config);
if (client.enabled) {
executionClients.push(client);
}
}
for (const consensusClientName of consensusList) {
const clientClass = consensus.ClientClasses[consensusClientName];
const client = clientClass.fromConfig(
provider,
network,
executionClients,
config
);
if (client.enabled) {
consensusClients.push(client);
}
}
Rocketpool.fromConfig(
provider,
network,
executionClients,
consensusClients,
config
);