Distributed Tracking based on Service Mesh
- Build & Run
- Trace Agent Proxy Server
- Build:
docker build . -t dt-srv -f serviceDockerfile
- Run:
docker run -d -p 8000:8000 dt-srv
- Build:
- Trace Collector
- Build:
docker build . -t dt-c
- Run:
docker run -d -p 9001:9001 dt-c
- Build:
- Trace Agent Proxy Server
-
Login Registry
docker login -u saintlyzero
-
Build & Push Trace Collector
docker build . -t dt-c
docker tag dt-c saintlyzero/agni:dt-c
docker push saintlyzero/agni:dt-c
- Build & Push Trace Agent Proxy
docker build . -t dt-pxy -f proxyDockerfile
docker tag dt-pxy saintlyzero/agni:dt-pxy
docker push saintlyzero/agni:dt-pxy
- Build & Push Trace Agent Microservice
cd agent/service-1
docker build . -t dt-srv-1
docker tag dt-srv-1 saintlyzero/agni:dt-srv-1
docker push saintlyzero/agni:dt-srv-1
cd agent/service-2
docker build . -t dt-srv-2
docker tag dt-srv-2 saintlyzero/agni:dt-srv-2
docker push saintlyzero/agni:dt-srv-2
- Port Forward
kubectl port-forward svc/agent 9000:9000
OR
- Expose Deployments
kubectl expose deployment agent --type=LoadBalancer --port=8000
- Get External IP
kubectl get services
- Create Minkube Tunnel (New Termninal)
minikube tunnel
kubectl port-forward agent 9000:9000
- Create Minkube Tunnel (New Termninal)
minikube tunnel
- Delete existing Service attached to the Deployment
kubectl delete service <service-name>
- Create a Service of type Load Balancer
kubectl expose deployment <deployment-name> --type=LoadBalancer --port=<specified-port>
kubectl expose deployment service-1 --type=LoadBalancer --port=9000
- Get External IP
kubectl get services
- Setup MySQL
cd database
kubectl apply -f mysql-deployment.yaml
kubectl apply -f mysql-service.yaml
kubectl apply -f mysql-client.yaml
- Access MySQL CLI
kubectl exec -it mysql-cli-pod -- /bin/sh
mysql -h mysql-service -u root -p -D bakasur
- Connection String from K8s
mysql://root:root@mysql-service:3306/bakasur
trace_id, source_id, parent_id, in_time, out_time, status
Check container logs of all pods
kubectl logs <pod-name> --all-containers -f
minikube stop
minikube start
kl delete deployment agent, collector
kl delete service agent, collector
kl apply -f agent/deployment.yaml
kl apply -f trace/deployment.yaml
kl port-forward svc/agent 9000:9000