MyGit

garystafford/k8s-istio-observe-backend

Fork: 78 Star: 188 (更新于 2024-11-15 08:49:36)

license: MIT

Language: Go .

Go-based microservices reference platform for demo of k8s observability with Istio

最后发布版本: v2.1.0 ( 2021-06-13 02:37:08)

官方网址 GitHub网址

Kubernetes-based Microservice Observability with Istio Service Mesh

Test build of services

Source code for the two-part blog post, Kubernetes-based Microservice Observability with Istio Service Mesh. Also, for the post, Observing gRPC-based Microservices on Amazon EKS running Istio . See these posts for detailed instructions.

Kiali

Frontend UI

An Angular 12 front-end UI to the API is located on Github: k8s-istio-observe-frontend.

preview

Reference Platform Architectures

RESTful JSON over HTTP architecture:

Architecture Diagram

gRPC using protobufs over HTTP/2 architecture:

Architecture Diagram

Service Responses

On the reference platform, each upstream service responds to requests from downstream services by returning a small informational JSON payload (termed a greeting in the source code).

{
  "id": "01596496-c6f3-442e-8fa0-26c09783fac6",
  "service": "Service A",
  "message": "Howdy, from Service A!",
  "created": "2021-07-03 13:24:16.43337955 +0000 UTC",
  "hostname": "service-a-5648545d66-ddq28"
}

Complete response from Service A

{
  "greeting": [
    {
      "id": "01596496-c6f3-442e-8fa0-26c09783fac6",
      "service": "Service A",
      "message": "Howdy, from Service A!",
      "created": "2021-07-03 13:24:16.43337955 +0000 UTC",
      "hostname": "service-a-5648545d66-ddq28"
    },
    {
      "id": "90da9923-8b0b-4c3c-93cb-cc3a17568a5d",
      "service": "Service B",
      "message": "Namasté (नमस्ते), from Service B!",
      "created": "2021-07-03 13:24:16.454971435 +0000 UTC",
      "hostname": "service-b-6685bdf588-297hl"
    },
    {
      "id": "6a43f52e-97c3-4fda-b9db-1257759cf5e9",
      "service": "Service D",
      "message": "Shalom (שָׁלוֹם), from Service D!",
      "created": "2021-07-03 13:24:16.476144396 +0000 UTC",
      "hostname": "service-d-5f486b99b5-j7gkc"
    },
    {
      "id": "0ee4ec6d-1107-44b5-b53f-d243e628867c",
      "service": "Service E",
      "message": "Bonjour, from Service E!",
      "created": "2021-07-03 13:24:16.550752623 +0000 UTC",
      "hostname": "service-e-6769679f5f-q4l8s"
    },
    {
      "id": "51b978c3-9cfc-420f-9fb3-956853dc76ae",
      "service": "Service G",
      "message": "Ahlan (أهلا), from Service G!",
      "created": "2021-07-03 13:24:16.568093421 +0000 UTC",
      "hostname": "service-g-7cd66567c5-lwpft"
    },
    {
      "id": "179c99ef-d8a6-4e53-abd9-bbd13476bf86",
      "service": "Service H",
      "message": "Nǐ hǎo (你好), from Service H!",
      "created": "2021-07-03 13:24:16.618275186 +0000 UTC",
      "hostname": "service-h-8468c7888-jtxn9"
    },
    {
      "id": "cbb05fd4-68c4-4281-83a5-3fcd402b93fc",
      "service": "Service C",
      "message": "Konnichiwa (こんにちは), from Service C!",
      "created": "2021-07-03 13:24:16.665208081 +0000 UTC",
      "hostname": "service-c-7c8d674595-hx5z7"
    }
  ]
}

Optional Docker Swarm Deployment

In addition to Kubernetes, you can deploy the reference platform to Docker Swarm. Create Docker overlay network, and deploy Docker Swarm, locally, consisting of (12) containers:

  • (1) Angular 12 frontend UI
  • (8) backend Go-based microservices
  • (1) RabbitMQ server with (1) queue
  • (1) MongoDB server with (4) databases
  • (1) Mongo Express
docker network create -d overlay --attachable golang-demo

docker stack deploy -c docker_swarm/stack.yml golang-demo

View the Running Stack

> docker stack services golang-demo --format "table {{.Name}}\t{{.Image}}\t{{.Ports}}" | sort

NAME                        IMAGE                                PORTS
golang-demo_angular-ui      garystafford/angular-observe:1.6.5   *:80->80/tcp
golang-demo_mongodb         mongo:4.4.6                          *:27017->27017/tcp
golang-demo_mongo_express   mongo-express:0.54.0                 *:8081->8081/tcp
golang-demo_rabbitmq        rabbitmq:3.8.16-management-alpine    *:5672->5672/tcp, *:15672->15672/tcp
golang-demo_service-a       garystafford/go-srv-a:1.6.5          *:8080->8080/tcp
golang-demo_service-b       garystafford/go-srv-b:1.6.5
golang-demo_service-c       garystafford/go-srv-c:1.6.5
golang-demo_service-d       garystafford/go-srv-d:1.6.5
golang-demo_service-e       garystafford/go-srv-e:1.6.5
golang-demo_service-f       garystafford/go-srv-f:1.6.5
golang-demo_service-g       garystafford/go-srv-g:1.6.5
golang-demo_service-h       garystafford/go-srv-h:1.6.5

Accessing the Docker Swarm-based Stack

To start, call the Angular 12 Frontend UI: http://localhost

The backend API's URL will be: http://localhost:8080

Alternately, call Service A, the system's edge service, directly: http://localhost:8080/api/greeting

To observe the queue traffic, use the RabbitMQ Management Console: http://localhost:15672

To observe the databases, use Mongo Express: http://localhost:8081

View of UI running on Docker

UI from Docker


The contents of this repository represent my viewpoints and not of my past or current employers, including Amazon Web Services (AWS). All third-party libraries, modules, plugins, and SDKs are the property of their respective owners.

最近版本更新:(数据更新于 2024-10-11 00:36:04)

2021-06-13 02:37:08 v2.1.0

2021-06-03 00:39:59 v2.0.0

2019-03-19 19:13:36 v1.3.0

2019-03-15 06:43:07 v1.2.0

2019-03-15 06:35:25 v1.0.0

主题(topics):

api, eks, gke, golang, isito, k8s, kubernetes, observability

garystafford/k8s-istio-observe-backend同语言 Go最近更新仓库

2024-11-22 20:14:47 daytonaio/daytona

2024-11-21 22:49:20 containerd/containerd

2024-11-21 13:50:50 XTLS/Xray-core

2024-11-21 07:36:18 kubernetes/kubernetes

2024-11-21 06:27:30 ollama/ollama

2024-11-21 05:17:55 Melkeydev/go-blueprint