Dead simple Kubernetes Example using Typescript and Express.
- Build Docker image
docker build . -t k8-test:1.0.0
- Apply kubernetes config
kubectl apply -f k8s.yaml
- Setup Nginx Ingress:
kubectl apply -f mandatory.yaml
kubectl apply -f cloud-generic.yaml
kubectl apply -f ingress.yaml
- Test Connection
curl -H "Host:k8-test.localhost" 127.0.0.1
- (optional) Scale deployment
kubectl scale --replicas=5 deployment/k8-test
To cleanup and delete all your pods: kubectl delete deployment k8-test
To cleanup and delete your services: kubectl delete service k8-test-service
A basic example has been setup using Tilt.. Really simple to try:
tilt up
edit src/app.ts
and see the results live!