K8sStudy/hello-k3d/Makefile

37 lines
951 B
Makefile
Raw Permalink Normal View History

2025-06-23 23:10:34 +00:00
2025-06-24 15:07:34 +00:00
all: cluster image load apply restart check
2025-06-23 23:10:34 +00:00
# TODO: maybe background this?
cluster:
2025-06-24 15:07:34 +00:00
k3d cluster create mycluster --port "8080:80@loadbalancer" --port "8443:443@loadbalancer"
kubectl label node k3d-mycluster-server-0 ingress-ready=true
2025-06-23 23:10:34 +00:00
k3d cluster list
image: Dockerfile
docker build -t shoppinglist-frontend:latest .
2025-06-24 15:07:34 +00:00
# TODO: This is not working on my system
2025-06-23 23:10:34 +00:00
load:
k3d image import shoppinglist-frontend:latest -c mycluster
2025-06-24 15:07:34 +00:00
#docker save shoppinglist-frontend:latest -o shoppinglist-frontend.tar
#k3d image import ./shoppinglist-frontend.tar -c mycluster
2025-06-23 23:10:34 +00:00
apply:
kubectl apply -f k8s/
2025-06-24 15:07:34 +00:00
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.10.0/deploy/static/provider/kind/deploy.yaml
2025-06-23 23:10:34 +00:00
restart:
kubectl delete pod -l app=shoppinglist-frontend
2025-06-24 15:07:34 +00:00
check:
kubectl get pods
kubectl get pods -n ingress-nginx
2025-06-23 23:10:34 +00:00
watch:
kubectl get pods -l app=shoppinglist-frontend -w
2025-06-24 15:07:34 +00:00
clobber:
k3d cluster delete mycluster
2025-06-23 23:10:34 +00:00