This is a solution for deploying a web application in a Kubernetes cluster.
-
allin.yaml— full manifest with comments - Helm chart with the same manifests
- Terraform — creates an AWS EKS cluster and installs the app using Helm chart
Nginx as a sample web app with:
- pods distribution across zones
- handling slow startup (5-10 sec)
- scales based on daily load pattern
- low CPU during steady state, with ability to get more if needed
- balance berween resilience and resource consumption
The K8s cluster with:
- 5 nodes, evenly-distributed in 3 zones
- Ingress/Nginx controller
Check your browser while port-forwarding:
Check scaling:

To get nodes with zones:
kubectl get nodes -L topology.kubernetes.io/zone
To get the pods:
kubectl get pods
To see the connection between pods and service:
kubectl describe ingress
Use the value from "Address" field instead of EXTERNAL-IP to get the Nginx web app welcome page:
curl -v EXTERNAL-IP -H "Host:my-app.example.com"
or run:
kubectl port-forward svc/my-web-app-service 8080:80
and check the http://localhost:8080 in your browser to see the Nginx web app welcome page.
To check scaling up:
kubectl create job --from=cronjob/scale-up-my-web-app manual-scale-up
kubectl get pods -o wide -w
To check scaling down:
kubectl create job --from=cronjob/scale-down-my-web-app manual-scale-down
kubectl get pods -o wide -w
kubectl apply -f allin.yaml
or
helm install web-app-release ./mychart
Requires: AWS CLI, Terraform, kubectl, Helm.
Add the secrets.auto.tfvars file with secrets for connecting AWS:
access_key = "your_access_key"
secret_key = "your_secret_key"
Run:
terarform init
terraform apply
Use the kubeconfig_command from the output to connect to the cluster.
kubectl delete -f allin.yaml
helm uninstall web-app-release
terraform destroy