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
The article "Why Shenzhen has more 5G base s...
[[420026]] Recently, Mobile China learned that ev...
At present, the digital economy has become the to...
On June 14, Cisco's annual networking and sec...
With the upcoming decommissioning of 2G/3G networ...
[[420219]] There are not many interview questions...
A friend of mine was looking for a host with AS99...
As data centers upgrade to 100Gbps at an accelera...
To learn more about open source, please visit: ...
The computer networks we typically imagine involv...
As the underlying technology of Bitcoin, blockcha...
Mobile networks have entered the 5G era, and thei...
Like most years, 2024 has seen a series of IT dis...
If you were to pick the most used feature in Chro...
According to a report by China Business News, Hua...