Skip to content

Commit

Permalink
Adding an example that deploys an application to an EKS cluster (pulu…
Browse files Browse the repository at this point in the history
  • Loading branch information
stack72 committed Apr 7, 2020
1 parent b37e356 commit b748d04
Show file tree
Hide file tree
Showing 6 changed files with 1,121 additions and 0 deletions.
2 changes: 2 additions & 0 deletions aws-go-eks/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/vendor/
aws-go-eks
3 changes: 3 additions & 0 deletions aws-go-eks/Pulumi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: aws-go-eks
runtime: go
description: Deploys a container into an EKS cluster with a Managed Node Group.
62 changes: 62 additions & 0 deletions aws-go-eks/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# AWS Golang EKS Cluster
This example creates an AWS EKS Cluster and deploys a sample container application to it

## Deploying the App

To deploy your infrastructure, follow the below steps.

### Prerequisites

1. [Install Pulumi](https://www.pulumi.com/docs/get-started/install/)
2. [Install Node.js 8.11.3](https://nodejs.org/en/download/)
3. [Configure AWS Credentials](https://www.pulumi.com/docs/intro/cloud-providers/aws/setup/)
4. [Install `aws-iam-authenticator`](https://docs.aws.amazon.com/eks/latest/userguide/install-aws-iam-authenticator.html)

### Steps

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

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

```bash
$ pulumi stack init dev
```

2. Set your desired AWS region:

```bash
$ pulumi config set aws:region us-east-1 # any valid AWS region will work
```

4. Execute the Pulumi program to create our lambda:

```bash
pulumi up
```

5. After 10-15 minutes, your cluster will be ready, and the kubeconfig JSON you'll use to connect to the cluster will
be available as an output. You can save this kubeconfig to a file like so:

```bash
$ pulumi stack output kubeconfig >kubeconfig.json
```

Once you have this file in hand, you can interact with your new cluster as usual via `kubectl`:

```bash
$ KUBECONFIG=./kubeconfig.json kubectl get nodes
```

6. Ensure that the application is running as expected:

```bash
$ curl $(pulumi stack output url)
```


7. Afterwards, destroy your stack and remove it:

```bash
pulumi destroy --yes
pulumi stack rm --yes
```
9 changes: 9 additions & 0 deletions aws-go-eks/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module aws-go-eks

go 1.13

require (
github.com/pulumi/pulumi-aws/sdk v1.30.0
github.com/pulumi/pulumi-kubernetes v1.6.0
github.com/pulumi/pulumi/sdk v1.14.0
)
Loading

0 comments on commit b748d04

Please sign in to comment.