# \[AIAB-04] Setup Online Boutique

To get the target application (Online Boutique), the load generator (Locust), and the telemetry provider (Prometheus) installed, you need to use the three Kubernetes manifests available in the `kube` folder of your cloned repo. The corresponding `kubectl` commands must be issued from any terminal pointing to your cluster.

Notice: if you have installed the minikube cluster with the scripts provided in this guide, you can skip this command and proceed to the paragraph *Install the target application*.

Notice that all these three manifests refer to a label `akamas/node=akamas` to ensure that the corresponding pods are scheduled on the same node. For the sake of simplicity, run the following command to assign this label to the node you want to use for these pods (this is not needed for the Minikube cluster, which already is correctly configured):

```bash
kubectl label node <NODE> akamas/node=akamas
```

#### Install the target application <a href="#user-content-install-the-target-application" id="user-content-install-the-target-application"></a>

To install the Online Boutique application, you need to apply the `boutique.yaml` manifest to your cluster with the following command:

```bash
kubectl apply -f kubernetes-online-boutique/kube/boutique.yaml
```

This command will create the namespace `akamas-demo` and all the Deployment and Services of the Online Boutique inside that namespace. You can verify that all the pods are up and running with the command:

```bash
watch -d kubectl get pods -n akamas-demo
```

You can wait until the output is similar to the following one, then proceed:

```
NAME                                        READY   STATUS    RESTARTS   AGE
ak-adservice-76cd99dffc-x8srv               1/1     Running   0          3m26s
ak-cartservice-5fbb6b6444-lw2lp             1/1     Running   0          3m18s
ak-checkoutservice-5bfc7765f9-lw4nd         1/1     Running   0          3m31s
ak-currencyservice-86b4779f5f-cwc8r         1/1     Running   0          3m25s
ak-emailservice-5dd45d469c-nkpj5            1/1     Running   0          3m32s
ak-frontend-56ddf7478b-q2b5z                1/1     Running   0          3m23s
ak-paymentservice-5756458bb8-4zmrh          1/1     Running   0          3m28s
ak-productcatalogservice-7bb94dff65-4n9sh   1/1     Running   0          3m20s
ak-recommendationservice-7f89d7fdc8-4dnmk   1/1     Running   0          3m21s
ak-redis-cart-6cc66bb4c9-rgggv              1/1     Running   0          3m16s
ak-shippingservice-fc6bbc6d5-6l2nl          1/1     Running   0          3m29s
```

#### Install the load generator <a href="#user-content-install-the-load-generator" id="user-content-install-the-load-generator"></a>

Then, to install Locust, you need to apply the `loadgenerator.yaml` manifest to your cluster:

```bash
kubectl apply -f kubernetes-online-boutique/kube/loadgenerator.yaml
```

You can verify that all the pods are up and running with the following command:

```bash
kubectl get pods -n akamas-demo -l app=ak-loadgenerator
```

The output should be similar to the following one:

```
ak-loadgenerator-5669ff6c96-nstcs           2/2     Running   0          10s
```

#### Install the telemetry provider <a href="#user-content-install-the-telemetry-provider" id="user-content-install-the-telemetry-provider"></a>

Finally, to install Prometheus, you need to apply the `prometheus.yaml` manifest:

```bash
kubectl apply -f kubernetes-online-boutique/kube/prometheus.yaml
```

You can verify that all the pods are up and running with the command:

```bash
kubectl get pods -n akamas-demo -l app=ak-prometheus
```

The output should be similar to the following one:

```
ak-prometheus-76b4b749b5-4g6wf                 1/1     Running   0          52s
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.akamas.io/quick-guides/quick-guides-akamas-in-a-box/aiab-04-optimize-a-java-based-kubernetes-application-online-boutique/aiab-04-setup-online-boutique.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
