https://github.com/nordcloud/aksworkshop
https://github.com/nordcloud/aksworkshop
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/nordcloud/aksworkshop
- Owner: nordcloud
- Created: 2019-10-07T07:14:41.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-10-14T08:17:32.000Z (almost 7 years ago)
- Last Synced: 2025-05-30T14:32:49.383Z (about 1 year ago)
- Size: 15.6 KB
- Stars: 1
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Configure Azure CLI to access your subscription
```
az login
az account set --subscription
```
## Create resource group for you cluster
```
az group create --name --location
```
## Create AKS cluster
```
az aks create --resource-group \
--name \
--location \
--kubernetes-version 1.15.3 \
--enable-addon monitoring
```
## Verify connectivity from kubectl
```
az aks get-credentials --resource-group --name
kubectl get nodes
```
## Install Helm
```
kubectl apply -f helm-rbac.yaml
helm init --service-account tiller
```
## Deploy MongoDB using Helm
```
helm install stable/mongodb --name orders-mongo --set mongodbUsername=orders-user,mongodbPassword=orders-password,mongodbDatabase=akschallenge
```
## Create MongoDB secret
```
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"
```
## Deploy backend and create service
```
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
```
## Verify connection between backend service and mongo
```
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
```
## Deploy frontend application
Edit `CAPTUREORDERSERVICEIP` in `frontend-deployment.yaml`, then deploy it
```
kubectl apply -f frontend-deployment.yaml
kubectl apply -f frontend-service.yaml
```
## Install ingress
```
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}"
```
## Configure Ingress
Edit `frontend-ingress.yaml` with your Ingress' IP address and deploy it
```
kubectl apply -f frontend-ingress.yaml
```
## Check your site
http://frontend.YOUR-INGRESS-IP-ADDRESS.nip.io
## Enable TLS on Ingress
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
```
## Run load test
Start the test
```
az container create -g -n loadtest --image azch/loadtest --restart-policy Never -e SERVICE_IP=
```
Check how it goes
```
az container logs -g -n loadtest
```
Stop it
```
az container delete -g -n loadtest
```
## Create Horizontal Pod Autoscaler
```
kubectl apply -f captureorder-hpa.yaml
```
Run the test again.