Skip to content

A sample application for learning how to service mesh

License

Notifications You must be signed in to change notification settings

naturalett/learn-layer5

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub contributors GitHub Docker Pulls Go Report Card GitHub issues by-label Website Twitter Follow Slack CII Best Practices

Learn Layer5

The Learn Layer5 sample application is to be available for use across all service meshes that Meshery supports and is to used as:

Application Architecture

The Learn Layer5 application includes three services: app-a, app-b, and app-c. Each service is listening on port 9091/tcp.

Service

The following are the routes defined by the service app and their functionality.

POST /call

This is the route whose metrics will be collected by the app. This route can be used to make the service call any other web service.

Simple POST request

# Command
curl --location --request POST 'http://localhost:9091/call' \
--data-raw ''
# No Output

service makes a POST request to "http://httpbin.org/post".

# Command
curl --location --request POST 'http://localhost:9091/call' \
--header 'Content-Type: application/json' \
--data-raw '{
"host": "http://httpbin.org/post",
"body": "{\n\t\"hello\": \"bye\"\n}"
}'
# Output
{
  "args": {}, 
  "data": "{\n\t\"hello\": \"bye\"\n}", 
  "files": {}, 
  "form": {}, 
  "headers": {
    "Accept-Encoding": "gzip", 
    "Content-Length": "19", 
    "Content-Type": "application/json", 
    "Host": "httpbin.org", 
    "User-Agent": "Go-http-client/1.1", 
  }, 
  "json": {
    "hello": "bye"
  }, 
  "origin": "...", 
  "url": "http://httpbin.org/post"
}

service makes a get request (as body is not provided) to http://httpbin.org/get.

# Command
curl --location --request POST 'http://localhost:9091/call' \
--header 'Content-Type: application/json' \
--data-raw '{
"host": "http://httpbin.org/get",
}'
# Output
{
  "args": {}, 
  "headers": {
    "Accept-Encoding": "gzip", 
    "Host": "httpbin.org", 
    "User-Agent": "Go-http-client/1.1", 
  }, 
  "origin": "...", 
  "url": "http://httpbin.org/get"
}

GET /metrics

Gets the metrics from service

# Command
curl --location --request GET 'localhost:9091/metrics' \
--header 'Content-Type: application/json' \
--data-raw '{
"hello": "bye"
}'
# Output
{
    "requestsReceived": "19", # Total requests service recieved
    "responsesFailed": "3",   # The responses of the requests the service made that failed
    "responsesSucceeded": "7" # The responses of the requests the service made that succeeded
}

DELETE /metrics

Clears the counters in service

# Command
curl --location --request DELETE 'localhost:9091/metrics' \
--header 'Content-Type: application/json' \
--data-raw '{
	"hello": "bye"
}'
# No Output



If you’re using Learn Layer5 or if you like the project, please star this repository to show your support! 🤩

Our projects are community-built and welcome collaboration. 👍 Be sure to see the Layer5 Contributor Welcome Guide for a tour of resources available to you and jump into our Slack! Contributors are expected to adhere to the CNCF Code of Conduct.

Layer5 Service Mesh Community

Layer5 Service Mesh Community

✔️ Join weekly community meeting on Fridays from 10am - 11am Central.
✔️ Watch community meeting recordings.
✔️ Access the community drive.

Not sure where to start? Grab an open issue with the help-wanted label.

About Layer5

Community First

The Layer5 community represents the largest collection of service mesh projects and their maintainers in the world.

Open Source First

We build projects to provide learning environments, deployment and operational best practices, performance benchmarks, create documentation, share networking opportunities, and more. Our shared commitment to the open source spirit pushes Layer5 projects forward.

License

This repository and site are available as open source under the terms of the Apache 2.0 License.

About

A sample application for learning how to service mesh

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 81.9%
  • Shell 9.5%
  • Makefile 6.2%
  • Dockerfile 2.4%