- Node 18 LTS
- Image on ACR
- Go to work dir
cd examples/webapp1
- Define ACR name
acrName=finallcloudacr.azurecr.io
- Image build
docker build --tag $acrName/node-webapp .
- Check result
docker images
Note: If you build the image on Apple Silicon processor, use the following flag: --platform linux/amd64
or --platform linux/arm/v7
- Local run:
docker run -d -p 8080:3000 --name nodedemo $acrName/node-webapp:latest
Check: http://localhost:8080
- Login to ACR
az acr login --name $acrName
- Create real version tag
docker tag $acrName/node-webapp:latest $acrName/node-webapp:1.0.0
- Upload images to ACR
docker push $acrName/node-webapp:latest
docker push $acrName/node-webapp:1.0.0
Check deployment file: node-webapp.yaml
Important parameters:
- Namespace: node-webapp
- replicas: 2 (it could be 1 ot more)
- Image: finallcloudacr.azurecr.io/node-webapp:latest
- host: node-webapp.finall.cloud (it must be your FQDN for your Raspberry Pi 5. Ip address is not acceptable)
kubectl apply -f node-webapp.yaml
- Get all resources from related namespace
kubectl get all -n node-webapp
- Get ingress info
kubectl get ingress -n node-webapp
Note: Ingress must have same address to Raspberry Pi 5.
# More Pods
kubectl -n node-webapp scale --replicas=5 deployment node-webapp-deployment
# Less pods
kubectl -n node-webapp scale --replicas=1 deployment node-webapp-deployment
# Delete all old pods
kubectl get pods -n node-webapp -o name | grep node-webapp-deployment | xargs kubectl delete -n node-webapp --wait=false
- Delete namespace
kubectl delete ns node-webapp --wait=false