## Day 78 - Install and Test a Service Mesh
> **Tutorial**
> *Let's install our first service mesh.*
I spent enough time on some theory on Day 77. Let's dig right into getting a service mesh up and running.
### Tasks
- Install the Istio service mesh with Demo Profile
- Deploy Bookinfo Application into the service mesh
- Test it's functionality
- Externally expose the application
### Installation + Prequisites
I highly advise using something like minikube or a cloud-based K8s cluster that allows you to have load-balancer functionality.
- A Kubernetes cluster running 1.22, 1.23, 1.24, 1.25
- KinD
- Minikube
- Civo K8s
- EKS
- Access to a Loadbalancer service
- Metallb
- port-forwarding (not preferred)
- Cloud Load-balancer
- Inlets
- Linux or macOS to run istoctl
**Environment setup**
In my case, I spun up a Civo K3s cluster with 3-nodes, 2 CPU per node, and 4GB of RAM per node.
This is important because you will need enough resources to run the service mesh control plane, which, is Istiod in our case. If you need a cluster in a pinch register for free credit @ civo.com.
#### Install Istio
1. Verify your cluster is up and operational and make sure there aren't any errors. The commands below will output nodes and their IPs and OS info and the running pods in all namespaces, respectively.
```
kubectl get nodes -o wide
kubectl get pods -A
```
2. Download Istio, which will pick up the latest version (at the time of writing its 1.16.1)
```
curl -L https://istio.io/downloadIstio | sh -
```
3. Change to the Istio directory
```
cd istio-1.16.1
```
4. Add the istioctl binary to your path
```
export PATH=$PWD/bin:$PATH
```
5. Check to verify that your environment is ready to go:
```
istioctl x precheck
```
And the output
```
✔ No issues found when checking the cluster. Istio is safe to install or upgrade!
To get started, check out https://istio.io/latest/docs/setup/getting-started/
```
6. Let's proceed to install Istio. We use the demo profile because it allows us to provide a minimal configuration to demonstrate functionality.
```
istioctl install --set profile=demo -y
```
You will see the following output:
```
✔ Istio core installed
✔ Istiod installed
✔ Egress gateways installed
✔ Ingress gateways installed
✔ Installation complete
```
7. Next, we can verify all the components are deployed as expected by running the command below, which proceeds to output all the Istio components.
```
kubectl get all -n istio-system
```
Your output should look similar in that all components are working. I changed my External-IP to *bring.your.LB.IP*, whcih means your IP will be different. Why do you need mine :P
```
NAME READY STATUS RESTARTS AGE
pod/istiod-885df7bc9-f9k7c 1/1 Running 0 31m
pod/istio-ingressgateway-6688c7f65d-szxf9 1/1 Running 0 31m
pod/istio-egressgateway-7475c75b68-mpxf7 1/1 Running 0 31m
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/istiod ClusterIP 10.43.249.242
Hello! This is a simple bookstore application consisting of three services as shown below