AWS Golang EKS Cluster
Deploys a container into an EKS cluster with a Managed Node Group.
This example lives in the pulumi/examples repository. Check out just this directory to use it:
git clone --filter=blob:none --sparse https://github.com/pulumi/examples pulumi-examplesgit -C pulumi-examples sparse-checkout set aws-go-ekscd pulumi-examples/aws-go-eksThis 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#
Steps#
After cloning this repo, run these commands from the working directory:
-
Create a new stack, which is an isolated deployment target for this example:
Terminal window pulumi stack init dev -
Set your desired AWS region:
Terminal window pulumi config set aws:region us-east-1 # any valid AWS region will work -
Execute the Pulumi program to create our EKS Cluster:
Terminal window pulumi up -
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:
Terminal window pulumi stack output kubeconfig --show-secrets >kubeconfig.jsonOnce you have this file in hand, you can interact with your new cluster as usual via
kubectl:Terminal window KUBECONFIG=./kubeconfig.json kubectl get nodes -
Ensure that the application is running as expected:
Terminal window curl $(pulumi stack output url) -
Afterwards, destroy your stack and remove it:
pulumi destroy --yespulumi stack rm --yes