forked from pulumi/examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding an example that deploys an application to an EKS cluster (pulu…
…mi#631) Related: pulumi/pulumi-kubernetes#1028
- Loading branch information
Showing
6 changed files
with
1,121 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/vendor/ | ||
aws-go-eks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
) |
Oops, something went wrong.