@@ -12,27 +12,34 @@ To deploy your infrastructure, follow the below steps.
12
12
### Prerequisites
13
13
14
14
1 . [ Install Pulumi] ( https://pulumi.io/install )
15
- 2 . [ Install Node.js 8.11.3] ( https://nodejs.org/en/download/ )
16
- 3 . [ Configure AWS Credentials] ( https://pulumi.io/install/aws.html )
17
- 4 . [ Install ` aws-iam-authenticator ` ] ( https://docs.aws.amazon.com/eks/latest/userguide/getting-started.html#get-started-kubectl )
15
+ 1 . [ Install Node.js version 6 or later] ( https://nodejs.org/en/download/ )
16
+ 1 . Install a package manager for Node.js, such as [ npm] ( https://www.npmjs.com/get-npm ) or [ Yarn] ( https://yarnpkg.com/en/docs/install ) .
17
+ 1 . [ Configure AWS Credentials] ( https://pulumi.io/install/aws.html )
18
+ 1 . [ Install ` aws-iam-authenticator ` ] ( https://docs.aws.amazon.com/eks/latest/userguide/getting-started.html#get-started-kubectl )
18
19
19
20
### Steps
20
21
21
22
After cloning this repo, from this working directory, run these commands:
22
23
23
24
1 . Install the required Node.js packages:
24
25
26
+ This installs the dependent packages [ needed] ( https://pulumi.io/reference/how.html ) for our Pulumi program.
27
+
25
28
``` bash
26
29
$ npm install
27
30
```
28
31
29
32
1. Create a new stack, which is an isolated deployment target for this example:
30
33
34
+ This will initialize the Pulumi program in TypeScript.
35
+
31
36
` ` ` bash
32
37
$ pulumi stack init
33
38
` ` `
34
39
35
- 1. Set the required configuration variables for this program:
40
+ 1. Set the required AWS configuration variables:
41
+
42
+ This sets configuration options and default values for our cluster.
36
43
37
44
` ` ` bash
38
45
$ pulumi config set aws:region us-west-2
@@ -47,6 +54,12 @@ After cloning this repo, from this working directory, run these commands:
47
54
itself is counted as a resource, though it does not correspond
48
55
to a physical cloud resource.
49
56
57
+ You can also run ` pulumi up --diff` to see and inspect the diffs of the
58
+ overall changes expected to take place.
59
+
60
+ Running ` pulumi up` will deploy the EKS cluster. Note, provisioning a
61
+ new EKS cluster takes between 10-15 minutes.
62
+
50
63
` ` ` bash
51
64
$ pulumi update
52
65
Previewing update (eks-demo):
@@ -205,23 +218,16 @@ After cloning this repo, from this working directory, run these commands:
205
218
in-place, and which require replacement, and computes
206
219
the minimally disruptive change to achieve the desired state.
207
220
208
- ** Note:** Pulumi auto-generates a suffix for all objects. Pulumi' s object model does
209
- create-before-delete replacements by default on updates, but this will only work if
210
- you are using name auto-generation so that the newly created resource is
211
- guaranteed to have a differing, non-conflicting name. Doing this
212
- allows a new resource to be created, and dependencies to be updated to
213
- point to the new resource, before the old resource is deleted.
214
- This is generally quite useful.
215
-
216
- ```
217
- ...
218
-
219
- + deploymentName : "helloworld-58jkmc7c"
220
- ...
221
- + namespaceName : "helloworld-xaldhgca"
222
- + serviceHostname: "a71f5ab3f2a6e11e3ac39200f4a9ad5d-1297981966.us-west-2.elb.amazonaws.com"
223
- + serviceName : "helloworld-3fc2uhh7"
224
- ```
221
+ > ** Note:** Pulumi auto-generates a suffix for all objects.
222
+ > See the [Pulumi Programming Model](../../reference/programming-model.md#autonaming) for more info.
223
+ >
224
+ > ` ` `
225
+ > deploymentName : " helloworld-58jkmc7c"
226
+ > ...
227
+ > namespaceName : " helloworld-xaldhgca"
228
+ > serviceHostname: " a71f5ab3f2a6e11e3ac39200f4a9ad5d-1297981966.us-west-2.elb.amazonaws.com"
229
+ > serviceName : " helloworld-3fc2uhh7"
230
+ > ` ` `
225
231
226
232
If you visit the FQDN listed in ` serviceHostname` you should land on the
227
233
NGINX welcome page. Note, that it may take a minute or so for the
@@ -259,10 +265,14 @@ After cloning this repo, from this working directory, run these commands:
259
265
$ kubectl delete deployment my-nginx
260
266
` ` `
261
267
268
+ Of course, by doing so, resources are outside of Pulumi' s purview, but this simply
269
+
262
270
1. Experimentation
263
271
264
272
From here on, feel free to experiment. Simply making edits and running `pulumi up` afterwords, will incrementally update your stack.
265
273
274
+ ### Running Off-the-Shelf Guestbook YAML
275
+
266
276
For example, if you wish to pull existing Kubernetes YAML manifests into
267
277
Pulumi to aid in your transition, append the following code block to the existing
268
278
`index.ts` file and run `pulumi up`.
@@ -304,7 +314,8 @@ After cloning this repo, from this working directory, run these commands:
304
314
);
305
315
306
316
// Export the Guestbook public LoadBalancer endpoint
307
- export const guestbookPublicIP = guestbook.getResourceProperty("v1/Service", "frontend", "status").apply(s => s.loadBalancer.ingress[0].ip);
317
+ export const guestbookPublicIP =
318
+ guestbook.getResourceProperty("v1/Service", "frontend", "status").apply(s => s.loadBalancer.ingress[0].ip);
308
319
```
309
320
310
321
1. Once you' ve finished experimenting, tear down your stack' s resources by destroying and removing it:
0 commit comments