forked from pulumi/examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ts
26 lines (22 loc) · 771 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
// Copyright 2016-2018, Pulumi Corporation. All rights reserved.
import * as k8s from "@pulumi/kubernetes";
import * as pulumi from "@pulumi/pulumi";
const config = new pulumi.Config();
const nginxLabels = { app: "nginx" };
const nginxDeployment = new k8s.apps.v1.Deployment("nginx-deployment", {
spec: {
selector: { matchLabels: nginxLabels },
replicas: config.getNumber("replicas") || 2,
template: {
metadata: { labels: nginxLabels },
spec: {
containers: [{
name: "nginx",
image: "nginx:1.7.9",
ports: [{ containerPort: 80 }],
}],
},
},
},
});
export const nginx = nginxDeployment.metadata.name;