https://github.com/dirien/berlin-pug-26-07
Demo code for the Berlin PUG
https://github.com/dirien/berlin-pug-26-07
Last synced: 2 months ago
JSON representation
Demo code for the Berlin PUG
- Host: GitHub
- URL: https://github.com/dirien/berlin-pug-26-07
- Owner: dirien
- Created: 2023-07-26T10:53:57.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-10-19T09:24:07.000Z (over 2 years ago)
- Last Synced: 2026-03-31T19:55:45.696Z (3 months ago)
- Language: Go
- Size: 66.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PUG Demo
This repository contains the demo code for the Pulumi User Group meetups.
## Infrastructure Deployment
The infrastructure deployment will be done using Pulumi AWS and EKS provider. As language we will use Go.
```bash
cd infrastructure-go
pulumi preview [--policy-pack ../policy-as-code/infra]
pulumi up [--policy-pack ../policy-as-code/infra]
```
After the infrastructure is deployed, we need to get the kubeconfig from the stack output and save it to a file.
```bash
pulumi stack output kubeconfig --show-secrets > kubeconfig.yaml
```
This is not a necessary step as we're going to use Pulumi Stack References to get the kubeconfig from the infrastructure
stack. See https://www.pulumi.com/learn/building-with-pulumi/stack-references/ for more details.
## Application Deployment
This deployment will be done using Pulumi AI. Head over to https://pulumi.com/ai and enter following prompt:
```text
Imagine you are a Kubernetes application developer and need to use a stack reference (dirien/pug-infrastructure-go/dev) to
get Kubeconfig from a different stack.
Then you create a Nginx (use the latest tag for the image) deployment with a custom config map, which contains "Hello
Pulumi World" as part of the nginx.conf location tag inside the server tag under http. This config map should then be mounted on /etc/nginx/. Finally, expose this deployment via a service
of type nodeport. Create an ingress also. The ingress class should be "alb". Add the missing annotations for the
application load Balancer "internet-facing" and "instance".
Create only one Kubernetes provider and pass it as dependency to the resources.
Finally Export the address of the ingress as output by interpolating the `http` protocol to it.
```
Here is a link to a working solution:
https://www.pulumi.com/ai/?convid=89a5a223-34bd-4b16-acb2-513f3cb2257c
```bash
cd application-ts
pulumi preview [--policy-pack ../policy-as-code/app]
```