{"id":19544284,"url":"https://github.com/mehrdadrad/servicemesh-examples","last_synced_at":"2025-04-26T17:32:57.160Z","repository":{"id":140640723,"uuid":"229166300","full_name":"mehrdadrad/servicemesh-examples","owner":"mehrdadrad","description":"simple service mesh example (3x microservices) with LINKERD ","archived":false,"fork":false,"pushed_at":"2020-01-09T19:35:33.000Z","size":571,"stargazers_count":22,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-01-05T04:46:41.017Z","etag":null,"topics":["linkerd","linkerd2","microservices","service-mesh"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mehrdadrad.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-20T01:21:25.000Z","updated_at":"2024-06-19T04:21:31.906Z","dependencies_parsed_at":null,"dependency_job_id":"4dc7393f-35e2-4481-a8fd-4e973e86e958","html_url":"https://github.com/mehrdadrad/servicemesh-examples","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehrdadrad%2Fservicemesh-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehrdadrad%2Fservicemesh-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehrdadrad%2Fservicemesh-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehrdadrad%2Fservicemesh-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mehrdadrad","download_url":"https://codeload.github.com/mehrdadrad/servicemesh-examples/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251026607,"owners_count":21525005,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["linkerd","linkerd2","microservices","service-mesh"],"created_at":"2024-11-11T03:26:28.736Z","updated_at":"2025-04-26T17:32:56.881Z","avatar_url":"https://github.com/mehrdadrad.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# servicemesh-examples\n\n![topo](/imgs/topo.png?raw=true \"linkerd\")\n\n\n## LINKERD\n#### install linkerd\n```\ncurl -sL https://run.linkerd.io/install | sh\nexport PATH=$PATH:$HOME/.linkerd2/bin\nlinkerd install | kubectl apply -f -\n```\n#### deploy microservices\n```\ngit clone https://github.com/mehrdadrad/servicemesh-examples.git\ncd servicemesh-examples/k8s\n\nkubectl apply -f backend.yaml\nkubectl apply -f middleware.yaml\nkubectl apply -f frontend.yaml\n```\n#### linkerd injection\n```\nkubectl get deploy/frontend-deployment -o yaml | linkerd inject - \\ | kubectl apply -f -\nkubectl get deploy/middleware-deployment -o yaml | linkerd inject - \\ | kubectl apply -f -\nkubectl get deploy/backend-deployment -o yaml | linkerd inject - \\ | kubectl apply -f -\n```\n#### pods status\n```\nkubectl get pods\nNAME                                     READY   STATUS    RESTARTS   AGE\nbackend-deployment-7c65c5cdbf-6gs9z      2/2     Running   0          3h19m\nbackend-deployment-7c65c5cdbf-m2ckt      2/2     Running   0          3h19m\nfrontend-deployment-697fb6566-prpd7      2/2     Running   0          4m5s\nfrontend-deployment-697fb6566-z78sx      2/2     Running   0          4m12s\nmiddleware-deployment-7599d78474-d4ftv   2/2     Running   0          4m24s\nmiddleware-deployment-7599d78474-lxrjm   2/2     Running   0          4m11s\n```\n#### load test\n```\nkubectl get svc frontend-external\nNAME                TYPE           CLUSTER-IP       EXTERNAL-IP      PORT(S)          AGE\nfrontend-external   LoadBalancer   10.107.208.163   192.168.55.102   8082:32415/TCP   16h\n\nwhile true; do curl 192.168.55.102:8082/time; sleep 2; done\n```\n\n#### linkerd cmd stat deployment\n```\nlinkerd stat deploy\nNAME                    MESHED   SUCCESS      RPS   LATENCY_P50   LATENCY_P95   LATENCY_P99   TCP_CONN\nbackend-deployment         2/2   100.00%   0.5rps          75ms          98ms         100ms          6\nfrontend-deployment        2/2   100.00%   0.5rps          75ms          98ms         100ms          2\nmiddleware-deployment      2/2   100.00%   0.5rps          75ms          98ms         100ms          6\n```\n\n#### linkerd top\n\n```\nlinkerd top deploy\n\n(press q to quit)\n\nSource                                  Destination                             Method      Path    Count    Best   Worst    Last  Success Rate\nfrontend-deployment-697fb6566-5s4rw     middleware-deployment-7599d78474-kn4hn  GET         /time      24    74ms   108ms   107ms       100.00%\nfrontend-deployment-697fb6566-5s4rw     middleware-deployment-7599d78474-wqw8r  GET         /time      24    78ms    96ms    88ms       100.00%\n10.44.0.0                               frontend-deployment-697fb6566-5s4rw     GET         /time      24    87ms   111ms    93ms       100.00%\nmiddleware-deployment-7599d78474-kn4hn  backend-deployment-5649869497-dtscv     GET         /time      22    70ms    97ms    83ms       100.00%\nbackend-deployment-5649869497-dtscv     12.23.14.17                             GET         /          22    68ms    89ms    72ms       100.00%\nmiddleware-deployment-7599d78474-wqw8r  backend-deployment-5649869497-dtscv     GET         /time      22    70ms    87ms    77ms       100.00%\nmiddleware-deployment-7599d78474-kn4hn  backend-deployment-5649869497-rvvwc     GET         /time      22    74ms    99ms    77ms       100.00%\nbackend-deployment-5649869497-rvvwc     12.23.14.17                             GET         /          22    70ms    93ms    76ms       100.00%\nmiddleware-deployment-7599d78474-wqw8r  backend-deployment-5649869497-rvvwc     GET         /time      22    74ms    88ms    80ms       100.00%\nfrontend-deployment-697fb6566-57h48     middleware-deployment-7599d78474-wqw8r  GET         /time      20    77ms    98ms    84ms       100.00%\nfrontend-deployment-697fb6566-57h48     middleware-deployment-7599d78474-kn4hn  GET         /time      20    83ms   107ms    87ms       100.00%\n10.44.0.0                               frontend-deployment-697fb6566-57h48     GET         /time      20    85ms   112ms    94ms       100.00%\n```\n\n#### linkerd tap\n```\nlinkerd tap deploy/middleware-deployment\n\nreq id=17:0 proxy=in  src=10.32.0.15:56874 dst=10.32.0.20:8081 tls=true :method=GET :authority=middleware.default.svc.cluster.local:8081 :path=/time\nreq id=17:1 proxy=out src=10.32.0.20:46488 dst=10.32.0.17:8080 tls=true :method=GET :authority=backend.default.svc.cluster.local:8080 :path=/time\nrsp id=17:1 proxy=out src=10.32.0.20:46488 dst=10.32.0.17:8080 tls=true :status=200 latency=114343µs\nend id=17:1 proxy=out src=10.32.0.20:46488 dst=10.32.0.17:8080 tls=true duration=73µs response-length=100B\nrsp id=17:0 proxy=in  src=10.32.0.15:56874 dst=10.32.0.20:8081 tls=true :status=200 latency=117368µs\nend id=17:0 proxy=in  src=10.32.0.15:56874 dst=10.32.0.20:8081 tls=true duration=72µs response-length=22B\n```\n```\nlinkerd tap deploy/frontend-deployment\n\nreq id=15:0 proxy=in  src=10.44.0.0:57314 dst=10.32.0.15:8082 tls=not_provided_by_remote :method=GET :authority=192.168.55.102:8082 :path=/time\nreq id=15:1 proxy=out src=10.32.0.15:48382 dst=10.32.0.4:8081 tls=true :method=GET :authority=middleware.default.svc.cluster.local:8081 :path=/time\nrsp id=15:1 proxy=out src=10.32.0.15:48382 dst=10.32.0.4:8081 tls=true :status=200 latency=89552µs\nend id=15:1 proxy=out src=10.32.0.15:48382 dst=10.32.0.4:8081 tls=true duration=78µs response-length=22B\nrsp id=15:0 proxy=in  src=10.44.0.0:57314 dst=10.32.0.15:8082 tls=not_provided_by_remote :status=200 latency=95348µs\nend id=15:0 proxy=in  src=10.44.0.0:57314 dst=10.32.0.15:8082 tls=not_provided_by_remote duration=37µs response-length=35B\n```\n```\nlinkerd tap deploy/backend-deployment\n\nreq id=18:0 proxy=in  src=10.32.0.20:44304 dst=10.32.0.3:8080 tls=true :method=GET :authority=backend.default.svc.cluster.local:8080 :path=/time\nreq id=18:1 proxy=out src=10.32.0.3:34434 dst=12.23.14.17:80  tls=not_provided_by_service_discovery :method=GET :authority=time.jsontest.com :path=/\nrsp id=18:1 proxy=out src=10.32.0.3:34434 dst=12.23.14.17:80  tls=not_provided_by_service_discovery :status=200 latency=71557µs\nend id=18:1 proxy=out src=10.32.0.3:34434 dst=12.23.14.17:80  tls=not_provided_by_service_discovery duration=63µs response-length=108B\nrsp id=18:0 proxy=in  src=10.32.0.20:44304 dst=10.32.0.3:8080 tls=true :status=200 latency=74675µs\nend id=18:0 proxy=in  src=10.32.0.20:44304 dst=10.32.0.3:8080 tls=true duration=54µs response-length=100B\n```\n\n\n\n\n\n\n\n\n#### linkerd and grafana dashboards screenshots\n\n```\nlinkerd dashboard \u0026\n```\n\n![linkerd](/imgs/Linkerd.png?raw=true \"linkerd\")\n![linkerd](/imgs/Linkerd_Control_Plane.png?raw=true \"linkerd\")\n![linkerd](/imgs/Linkerd_Backend_Grafana.png?raw=true \"linkerd\")\n![linkerd](/imgs/Linkerd_Middleware_Grafana.png?raw=true \"linkerd\")\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmehrdadrad%2Fservicemesh-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmehrdadrad%2Fservicemesh-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmehrdadrad%2Fservicemesh-examples/lists"}