Skip to content

Commit fd2d349

Browse files
committed
aws(eks-hello-world): add clarifying info based on TGIK8s feedback
1 parent 694a662 commit fd2d349

File tree

2 files changed

+34
-22
lines changed

2 files changed

+34
-22
lines changed

aws-ts-eks-hello-world/README.md

Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,34 @@ To deploy your infrastructure, follow the below steps.
1212
### Prerequisites
1313

1414
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)
1819

1920
### Steps
2021

2122
After cloning this repo, from this working directory, run these commands:
2223

2324
1. Install the required Node.js packages:
2425

26+
This installs the dependent packages [needed](https://pulumi.io/reference/how.html) for our Pulumi program.
27+
2528
```bash
2629
$ npm install
2730
```
2831

2932
1. Create a new stack, which is an isolated deployment target for this example:
3033

34+
This will initialize the Pulumi program in TypeScript.
35+
3136
```bash
3237
$ pulumi stack init
3338
```
3439

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.
3643

3744
```bash
3845
$ pulumi config set aws:region us-west-2
@@ -47,6 +54,12 @@ After cloning this repo, from this working directory, run these commands:
4754
itself is counted as a resource, though it does not correspond
4855
to a physical cloud resource.
4956

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+
5063
```bash
5164
$ pulumi update
5265
Previewing update (eks-demo):
@@ -205,23 +218,16 @@ After cloning this repo, from this working directory, run these commands:
205218
in-place, and which require replacement, and computes
206219
the minimally disruptive change to achieve the desired state.
207220

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+
> ```
225231

226232
If you visit the FQDN listed in `serviceHostname` you should land on the
227233
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:
259265
$ kubectl delete deployment my-nginx
260266
```
261267

268+
Of course, by doing so, resources are outside of Pulumi's purview, but this simply
269+
262270
1. Experimentation
263271
264272
From here on, feel free to experiment. Simply making edits and running `pulumi up` afterwords, will incrementally update your stack.
265273
274+
### Running Off-the-Shelf Guestbook YAML
275+
266276
For example, if you wish to pull existing Kubernetes YAML manifests into
267277
Pulumi to aid in your transition, append the following code block to the existing
268278
`index.ts` file and run `pulumi up`.
@@ -304,7 +314,8 @@ After cloning this repo, from this working directory, run these commands:
304314
);
305315
306316
// 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);
308319
```
309320
310321
1. Once you've finished experimenting, tear down your stack's resources by destroying and removing it:

aws-ts-eks-hello-world/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Copyright 2016-2019, Pulumi Corporation. All rights reserved.
12
import * as awsx from "@pulumi/awsx";
23
import * as eks from "@pulumi/eks";
34
import * as k8s from "@pulumi/kubernetes";

0 commit comments

Comments
 (0)