$region="eastus"
$clusterName="aks-workshop-lra"
$kubernetesVersionLatest=$(az aks get-versions -l ${region} --query 'orchestrators[-1].orchestratorVersion' -o tsv)
az group create --name akschallenge --location $region
az aks create --resource-group akschallenge --name $clusterName --enable-addons monitoring --kubernetes-version $kubernetesVersionLatest --generate-ssh-keys --location $region
az aks get-credentials --resource-group akschallenge --name $clusterName
If using RBAC, a temporary approach to view the dashboard locally is to grant access to the service account.
Consider using Azure AD
kubectl create clusterrolebinding kubernetes-dashboard --clusterrole=cluster-admin --serviceaccount=kube-system:kubernetes-dashboard
kubectl get nodes
az aks browse --resource-group akschallenge --name aks-workshop-lra
https://helm.sh/docs/using_helm/
choco install kubernetes-helm
kubectl apply -f helm-rbac.yaml
helm init --service-account tiller
helm install stable/mongodb --name orders-mongo --set mongodbUsername=orders-user,mongodbPassword=orders-password,mongodbDatabase=akschallenge
update environment variables
kubectl apply -f captureorder-deployment.yaml
kubectl get pods -l app=captureorder
kubectl logs -l app=captureorder
kubectl describe pod -l app=captureorder
kubectl apply -f captureorder-service.yaml
kubectl get service captureorder -o jsonpath="{.status.loadBalancer.ingress[*].ip}"
curl -d '{"EmailAddress": "[email protected]", "Product": "prod-1", "Total": 100}' -H "Content-Type: application/json" -X POST http://[Your Service Public LoadBalancer IP]/v1/order
Update CAPTUREORDERSERVICEIP
environment variable
kubectl apply -f frontend-deployment.yaml
kubectl get pods -l app=frontend
az resource create --resource-group akschallenge --resource-type "Microsoft.Insights/components" --name akschallengeproctor --location eastus --properties '{\"Application_Type\":\"web\"}'
az resource show -g akschallenge -n akschallengeproctor --resource-type "Microsoft.Insights/components" --query properties.InstrumentationKey
Analytics
requests
| where success == "True"
| where customDimensions["team"] != "team-azch"
| summarize rps = count(id) by bin(timestamp, 1s), tostring(customDimensions["team"])
| summarize maxRPS = max(rps) by customDimensions_team
| order by maxRPS desc
| render barchart
Use the Service Principal approach by defualt. If issues occur another approach is to use the built-in account that the container registry exposes.
az acr login -n acraksworkshoplra
az acr update -n acraksworkshoplra --admin-enabled true
az acr credential show -n acraksworkshoplra
kubectl create secret docker-registry acr-auth --docker-server acraksworkshoplra.azurecr.io --docker-username [docker_id] --docker-password [docker_secret] --docker-email [email]