+
+> View the current number of replicas for the store-front service
+
+```bash
+kubectl get deployment store-front
+```
+
+You should see the following output.
+
+```bash
+NAME READY UP-TO-DATE AVAILABLE AGE
+store-front 1/1 1 1 92m
+```
+
+Notice that there is currently only 1 replica running of the `store-front` service.
+
+
+
+> Scale the number of replicas for the store-front service to 10
+
+```bash
+kubectl scale deployment store-front --replicas=10
+```
+
+You should see the following output.
+
+```bash
+deployment.apps/store-front scaled
+```
+
+Scaling to 10 replicas may take a moment. You can view the increased number of replicas by viewing the `store-front` deployment again.
+
+```bash
+kubectl get deployment store-front
+```
+
+If scaling the `store-front` deployment was successfully, you should now see `READY` and `AVAILABLE` number of replicas as 10.
+
+```bash
+NAME READY UP-TO-DATE AVAILABLE AGE
+store-front 10/10 10 10 103m
+```
+
+We will now return the number of replicas of the `store-front` service back to 1.
+
+```bash
+kubectl scale deployment store-front --replicas=1
+```
+
+### Automatically scaling your application
+
+To automatically scale your deployments, you can use the Horizontal Pod Autoscale (HPA) setting. This is a more preferred approach to scale you applicaiton, as it allows you to define a set of resource requests and limits, for CPU and memory, that your application can support safely to stay operational. Once an HPA configuraiton has been set for your deployment, Kubernetes will track application pod resource utilization and will scale your deployment automatically if the limits of your resource configuraiton has been met.
+
+Let's first take a look and view the current CPU and memory requests and limits for the `store-front` deployment.
+
+```bash
+kubectl describe deployment store-front
+```
+
+A description of the `store-front` deployment is returned. Under the Pod Template\Containers section, you should see the following limits and requests:
+
+```bash
+Limits:
+ cpu: 1
+ memory: 512Mi
+Requests:
+ cpu: 1m
+ memory: 200Mi
+```
+
+As a quick explanation of the `store-front` deployment requests and limits configuration, this configuration limits the `store-front` deployment up to 1 CPU core and 512Mi of memory, which is the equivalent of 1MB of memory. That is the hardware limit of resources allowed by each pod in the deployment. The request section specifies the minimum ammount of resources the container is gauranteed to have from the hardware resources available. In this case, each `store-front` pod is gauranteed to have 1m (millicore) of CPU, which is 0.001 CPU, and 200Mi, which is approximately 209MB.
+
+Let's first take a look and see if an HPA configuration exists for the `store-front` deployment.
+
+```bash
+kubectl get hpa store-front
+```
+
+If no HPA configuration exists, you will see an error similar to:
+
+```bash
+Error from server (NotFound): horizontalpodautoscalers.autoscaling "store-front" not found
+```
+
+Let's now create a HPA configuration for the `store-front` deployment.
+
+We will create a HPA policy that will allow the HPA controller to increase or decrease the number of pods from 1 to 10, based on the pods keeping an average of 50% CPU utilization.
+
+```bash
+kubectl autoscale deployment store-front --cpu-percent=50 --min=1 --max=10
+```
+
+The output of the command
+
+```bash
+horizontalpodautoscaler.autoscaling/store-front autoscaled
+```
+
+We can then verify that an HPA policy exists for the `store-front` deployment.
+
+```bash
+kubectl get hpa store-front
+```
+
+You should see the following output:
+
+```
+NAME REFERENCE TARGETS MINPODS MAXPODS REPLICAS AGE
+store-front Deployment/store-front 100%/50% 1 10 2 2m4s
+```
+
+In my example output, notice that the HPA autoscaler has already added an additional replica (instance) of the `store-front` deployment to meet the HPA configuration.
+
+We will now deploy an application to simulate additional client load to the `store-front` deployment. In a seperate terminal, that has kubeclt access to your cluster, run the following command:
+
+```bash
+kubectl run -i --tty load-generator --rm --image=busybox:1.28 --restart=Never -- /bin/sh -c "while sleep 0.01; do wget -q -O- http://store-front; done"
+```
+
+After running the previous command, return back to your original terminal, where we will again look at the HPA policy for the `store-front` deployment to see if we have increased the need for replicas to meet the policy configuration.
+
+```bash
+kubectl get hpa store-front
+```
+
+You should see that the load generating application allowed the automatic scaling of the `store-front` deploymente to reach the maxium replica limit of 10.
+
+```bash
+NAME READY UP-TO-DATE AVAILABLE AGE
+store-front 10/10 10 10 4h13m
+```
+
+You can now terminate the load generating terminal, by either using ctrl+C, or closing the terminal window.
+
+You can also remove the HPA configuration for the `store-front` deployment by running the following command:
+
+```bash
+kubectl delete hpa store-front
+horizontalpodautoscaler.autoscaling "store-front" deleted
+```
+
+---
+
# Observability
Monitoring and observability are key components of running applications in production. With AKS Automatic, you get a lot of monitoring and observability features enabled out-of-the-box. If you recall from the beginning of the workshop, we created an [Azure Log Analytics Workspace](https://learn.microsoft.com/azure/azure-monitor/logs/log-analytics-overview) with [Container Insights](https://learn.microsoft.com/azure/azure-monitor/containers/container-insights-overview) to collect application logs, [Azure Monitor Managed Workspace](https://learn.microsoft.com/azure/azure-monitor/containers/kubernetes-monitoring-enable?tabs=cli) to with [Prometheus recording rules](https://learn.microsoft.com/azure/azure-monitor/containers/prometheus-metrics-scrape-default) enabled to capture metrics from workloads within the cluster, and [Azure Managed Grafana](https://azure.microsoft.com/products/managed-grafana) to visualize the metrics.