A microservice application that allows users to vote for their favorite emoji and keeps track of the votes received on a leaderboard. May the best emoji win. The application consists of the following 3 services: emojivoto-web: Web frontend and REST API
emojivoto-emoji-svc: gRPC API for finding and listing emojis
emojivoto-voting-svc: gRPC API for voting and leaderboards
Actual CombatTencent Cloud K8S Cluster Practice Service Mesh—Linkerd2 & Traefik2 Deployment of emojivoto Application runIn Minikube Deploy the application to Minikube using the Linkerd2 service mesh. 1. Install linkerd CLI
2. Install Linkerd2
3. Check out the dashboard!
4.Inject, Deploy, and Enjoy
5. Use apps!
In docker-compose It is also possible to run the application using docker-compose (without Linkerd2). Build and run:
The web application will run on port 8080 of the docker host. Via URL Standalone deployment to an existing cluster:
Generate some traffic The VoteBot service can bring you some traffic. It votes "randomly" on emojis like this:
If you ran the application using the above instructions, VoteBot will be deployed and will start sending traffic to the voting endpoint. If you want to run the bot manually:
Release a new versionTo build and push a multi-arch docker image: 1. Update the tag name in common.mk 2. Create a Buildx builder instance
3. Build & push multi-arch docker image to hub.docker.com
4. Update:
5. Distribute to the Linkerd website repo
Prometheus metricsBy default, the voting service exposes Prometheus metrics about the current vote count on port 8801. This can be disabled by unsetting the PROM_PORT environment variable. Local DevelopmentEmojivoto webapp This application is written in React and bundled using webpack. Use the following command to run emojivoto go services and develop on the front-end. Set up the proto file and build the application
Start voting service
[In a separate terminal window] Start the emoji server
[In a separate terminal window] Bundle frontend resources
[In a separate terminal window] Start the web server
[Optional] Start a voting bot to automatically generate traffic.
View emojivoto
Testing the Linkerd Service Configuration File Service Profiles are a feature of Linkerd that provide per-route functionality such as telemetry, timeouts, and retries. The Emojivoto application aims to showcase service profiles with the following instructions. Service Profiles: https://linkerd.io/2/features/service-profiles Generate ServiceProfile definition from .proto file The emoji and voting services are gRPC applications that have Protocol Buffers (protobuf) definition files. These .proto files can be used as input to the linkerd profile command to create a ServiceProfile definition yaml file. The Linkerd Service Profile documentation outlines the steps required to create the yaml file, and these are the commands you can use from the root of that repository:
Protocol Buffers (protobuf): https://developers.google.com/protocol-buffers gRPC: https://grpc.io Linkerd Service Profile documentation: https://linkerd.io/2/tasks/setting-up-service-profiles/#protobuf Each of these commands will output YAML, which you can write to a file or pipe directly to kubectl apply. For example:
Generate ServiceProfile definition for Web deployment emojivoto's web-svc deployment is a React application hosted by a Go server. We can use linkerd profile auto creation to generate a ServiceProfile resource for web-svc using the following command:
Now that service configuration files are generated for all services, you can observe per-service route metrics on the Linkerd Dashboard or using the linkerd routes command.
linkerd profile auto creation
Linkerd Dashboard
|
>>: Unexpectedly, China Unicom is the biggest loser in number portability
Today’s workflows are increasingly digital, and v...
Big data continues to impact large-scale enterpri...
It has been more than a year and a half since my ...
V.PS is a site under xTOM (founded in 2012). V.PS...
Huawei strongly opposes the US Department of Comm...
In order to let more users experience its VPS hos...
Since the official implementation of the "nu...
"Short-term cooperation, long-term competiti...
As science and technology develops at an increasi...
We often hear network operators and equipment ven...
HostVDS has been established for some time. The m...
According to a recent research report released by...
In places where high-density WI-FI terminals are ...
V5.NET is offering a limited promotion for the HK...
Traditional switch operating systems (NOS) are a ...