Istio Service Mesh Architecture
Please refer to the following github repo for setting up a local kubernetes environment using KinD and LoadBalancer using Metallb.
Create Multi-Node Local Kubernetes Cluster (KinD) with LoadBalancer (Metallb)
brew install istioctl
For this application, we use the demo configuration profile. It’s selected to have a good set of defaults for testing, but there are other profiles for production or performance testing.
istioctl install --set profile=demo -y
k label namespace default istio-injection=enabled
k apply -f https://raw.githubusercontent.com/istio/istio/release-1.18/samples/bookinfo/platform/kube/bookinfo.yaml
k get all
To confirm that the Bookinfo application is running, send a request to it by a curl command from some pod, for example from ratings:
k exec "$(k get pod -l app=ratings -o jsonpath='{.items[0].metadata.name}')" -c ratings -- curl -sS productpage:9080/productpage | grep -o "<title>.*</title>"
The Bookinfo application is deployed but not accessible from the outside. To make it accessible, you need to create an Istio Ingress Gateway, which maps a path to a route at the edge of your mesh.
kubectl apply -f https://raw.githubusercontent.com/istio/istio/release-1.18/samples/bookinfo/networking/bookinfo-gateway.yaml
istioctl analyze
export INGRESS_HOST=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
export INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].port}')
export SECURE_INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="https")].port}')
export GATEWAY_URL=$INGRESS_HOST:$INGRESS_PORT
echo "$GATEWAY_URL"
Confirm that the Bookinfo application is accessible from outside by viewing the Bookinfo product page using a browser.
Run the following command to retrieve the external address of the Bookinfo application
echo "http://$GATEWAY_URL/productpage"
Paste the output from the previous command into your web browser and confirm that the Bookinfo product page is displayed.
Istio integrates with several different telemetry applications. These can help you gain an understanding of the structure of your service mesh, display the topology of the mesh, and analyze the health of your mesh.
Use the following instructions to deploy the Kiali dashboard, along with Prometheus, Grafana, and Jaeger.
kubectl apply -f istio-samples-addons -R
kubectl rollout status deployment/kiali -n istio-system
Grafana k6 is an open-source load testing tool that makes performance testing easy and productive for engineering teams. k6 is free, developer-centric, and extensible.
import http from 'k6/http';
export const options = {
stages: [
{ duration: '2m', target: 100 }, // traffic ramp-up from 1 to 100 users over 5 minutes.
{ duration: '5m', target: 200 }, // stay at 200 users for 5 minutes
{ duration: '2m', target: 100 }, // ramp-down to 100 users
],
};
export default () => {
const urlRes = http.get('http://172.19.255.201/productpage');
};
k6 run average-load.js
k get all