az login
az account set --subscription <subscriptionId>
az group create --name <resource-group> --location <region>
az aks create --resource-group <resource-group> \
--name <cluster-name> \
--location <region> \
--kubernetes-version 1.15.3 \
--enable-addon monitoring
az aks get-credentials --resource-group <resource-group> --name <cluster-name>
kubectl get nodes
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
kubectl create secret generic mongodb --from-literal=mongoHost="orders-mongo-mongodb.default.svc.cluster.local" --from-literal=mongoUser="orders-user" --from-literal=mongoPassword="orders-password"
kubectl apply -f captureorder-deployment.yaml
kubectl apply -f captureorder-service.yaml
Wait for couple of minutes for ALB to assign a public IP
kubectl get service captureorder -o jsonpath="{.status.loadBalancer.ingress[*].ip}" -w
curl -d '{"EmailAddress": "email@domain.com", "Product": "prod-1", "Total": 100}' -H "Content-Type: application/json" -X POST http://[Your Service Public LoadBalancer IP]/v1/order
Edit CAPTUREORDERSERVICEIP
in frontend-deployment.yaml
, then deploy it
kubectl apply -f frontend-deployment.yaml
kubectl apply -f frontend-service.yaml
helm repo update
helm upgrade --install ingress stable/nginx-ingress --namespace ingress
Wait for a couple of minutes and get public IP of ingress
kubectl get svc -n ingress ingress-nginx-ingress-controller -o jsonpath="{.status.loadBalancer.ingress[*].ip}"
Edit frontend-ingress.yaml
with your Ingress' IP address and deploy it
kubectl apply -f frontend-ingress.yaml
http://frontend.YOUR-INGRESS-IP-ADDRESS.nip.io
Install certmanager
helm install stable/cert-manager --name cert-manager --set ingressShim.defaultIssuerName=letsencrypt --set ingressShim.defaultIssuerKind=ClusterIssuer --version v0.5.2
Update Ingress configuration with TLS (remember to edit the file first)
kubectl apply -f frontend-ingress-tls.yaml
Verify it's up and running
kubectl describe certificate frontend
Start the test
az container create -g <resource-group> -n loadtest --image azch/loadtest --restart-policy Never -e SERVICE_IP=<public ip of order capture service>
Check how it goes
az container logs -g <resource-group> -n loadtest
Stop it
az container delete -g <resource-group> -n loadtest
kubectl apply -f captureorder-hpa.yaml
Run the test again.