az login
az account set --subscription 79080195-8aac-4282-8f0d-5910cb4209c0
az aks get-credentials --resource-group RG-SB-LAB-01 --name akssb01
kubectl config use-context docker-desktop
docker run -it --rm -p 8000:80 --name aspnetcore_sample mcr.microsoft.com/dotnet/samples:aspnetapp
For Azure ACR:
az acr login -n acrlab01
Username: <username>
Password: <password>
docker images
docker tag <source image> acrlab01.azurecr.io/<target image>:<tag>
docker push acrlab01.azurecr.io/<target image>:<tag>
kubectl create deployment <your-name>01 --image=<username>/<target image>:<tag> --replicas=2
kubectl get deployments
kubectl describe deployment <your-deployment-name>
kubectl expose deployment < your-deployment-name> --type=LoadBalancer --port=80 --target-port=80 #map service port 80 to container port 80
kubectl scale deployment < your-deployment-name> --replicas=3
Retag and push v2 of the image to docker hub
kubectl set image deployment/<your-deployment-name> <container-name>=<username>/<target>:v2
Verify the upgrade
Kubectl describe deployment <deployment-name>
Get the revision history of your deployment
kubectl rollout history deployment/<deployment-name>
Rollback your deployment to the previoud version
kubectl rollout undo deployment/<deployment-name>
Rollback your deployment to a specific version
kubectl rollout undo deployment/<deployment-name> --to-revision 1
kubectl apply -f deployment.yaml
kubectl apply -f service.yaml