| name | aks-deployment |
| description | Deploying and debugging Toygres on AKS (Azure Kubernetes Service). Use when deploying, debugging pods, viewing logs, troubleshooting SSL, or managing Kubernetes resources. |
AKS Deployment & Debugging
Deployment
./deploy/deploy-to-aks.sh --https
kubectl rollout restart deployment/toygres-server -n toygres-system
kubectl rollout status deployment/toygres-server -n toygres-system
Viewing Logs
kubectl logs -n toygres-system -l app.kubernetes.io/component=server -f
kubectl logs -n toygres-system -l app.kubernetes.io/component=ui -f
kubectl logs -n toygres-system <pod-name> --previous
Pod Management
kubectl get pods -n toygres-system
kubectl describe pod <pod-name> -n toygres-system
kubectl exec -it <pod-name> -n toygres-system -- /bin/sh
kubectl delete pod <pod-name> -n toygres-system
Common Issues
Pod CrashLoopBackOff
kubectl logs <pod-name> -n toygres-system --previous
Image Not Updating
kubectl rollout restart deployment/toygres-server -n toygres-system
kubectl delete pod -n toygres-system -l app.kubernetes.io/component=server
SSL Certificate Issues
kubectl get certificate -n toygres-system
kubectl describe certificate toygres-tls -n toygres-system
kubectl get ingress -n toygres-system
kubectl describe ingress toygres-ingress -n toygres-system
Azure Workload Identity / azcopy 403 Errors
If azcopy login --identity succeeds but operations fail with 403 AuthorizationPermissionMismatch:
Root cause: azcopy --identity uses VM-based managed identity (IMDS), not AKS workload identity.
Fix: Use --login-type=workload explicitly:
azcopy login --identity
azcopy login --login-type=workload
Debug workload identity:
kubectl exec <pod> -- env | grep AZURE_
az login --federated-token "$(cat $AZURE_FEDERATED_TOKEN_FILE)" \
--service-principal -u $AZURE_CLIENT_ID -t $AZURE_TENANT_ID
az storage blob list --account-name <acct> --container-name <container> --auth-mode login
Azure LoadBalancer DNS Propagation
Problem: Instance provisioning fails at test_connection even though service is created.
Root cause: Azure DNS propagation for LoadBalancer services takes 60-90+ seconds after IP is assigned.
Timeline:
- LoadBalancer created → IP assigned (10-30s)
- DNS record created → DNS propagates (30-60+ additional seconds)
- Total wait time can be 60-90+ seconds
Fix: Use 120s timeout for connection tests, not 60s:
RetryPolicy::new(5)
.with_timeout(Duration::from_secs(120))
Debug DNS propagation:
kubectl get svc -n toygres-managed <svc-name>
nslookup <dns-label>.westus2.cloudapp.azure.com
kubectl get svc -n toygres-managed -w
Local Testing Before Deploy
kubectl scale deployment toygres-server -n toygres-system --replicas=0
./scripts/start-control-plane.sh
kubectl scale deployment toygres-server -n toygres-system --replicas=1