Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hb-chen/micro-starter
Micro 微服务实践
https://github.com/hb-chen/micro-starter
consul docker go-micro istio k8s kubernetes micro microservices servicemesh
Last synced: 7 days ago
JSON representation
Micro 微服务实践
- Host: GitHub
- URL: https://github.com/hb-chen/micro-starter
- Owner: hb-chen
- License: mit
- Created: 2017-08-29T12:17:10.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2024-01-11T04:39:43.000Z (about 1 year ago)
- Last Synced: 2025-01-13T04:05:30.790Z (14 days ago)
- Topics: consul, docker, go-micro, istio, k8s, kubernetes, micro, microservices, servicemesh
- Language: Go
- Homepage:
- Size: 1.35 MB
- Stars: 398
- Watchers: 17
- Forks: 61
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Micro [github.com/micro](http://github.com/micro)
[![Slack](https://img.shields.io/badge/slack-join-D60051.svg)](https://hbchen.slack.com/messages/CE68CJ60Z)
![go-micro](/doc/img/micro.jpg "go-micro")
## Local
Build micro cmd
```shell script
go build -o bin/micro cmd/micro/main.go
```Start registry & api with server runtime
```shell script
./bin/micro --profile starter-local server
```Start registry & api with service command
Run registry service
```shell script
./bin/micro --profile starter-local service registry
```Run API service
```shell script
./bin/micro --profile starter-local service api
```Run example service
```shell script
# Greeting
cd service/greeting
CGO_ENABLED=0 go run main.go --profile starter-local
```Test example service
```shell script
# Greeting
curl "http://localhost:8080/greeting/call?msg=helloworld"
{"id":"1","msg":"helloworld"}curl "http://localhost:8080/greeting/list?page=1&size=10"
{"items":[{"id":"1","msg":"helloworld"}]}
```## Kubernetes
```shell
$ make snapshot$ docker build ./ -f Dockerfile --platform=linux/amd64 -t registry.cn-hangzhou.aliyuncs.com/hb-chen/micro-starter-micro:latest
```> Attention: default ingress class=nginx, host=api.micro.hbchen.com
```shell
helm install -n micro micro-server manifests/charts/micro \
--set ingress.enabled=true# Digest
helm install -n micro micro-server manifests/charts/micro \
--set image.tag="latest@sha256:aceabd67ac333dcd19bde3524c54e7a556b8651cf049495ab6e086d45bb7ad77" \
--set ingress.enabled=true
``````shell
helm install -n micro micro-example manifests/charts/service# Digest
helm install -n micro micro-example manifests/charts/service \
--set image.tag="latest@sha256:a2af30ff9a0a66ade77672e01679a2b02ead3b2b0f27bd7092d726d75fd069e0"
``````shell
curl "http://api.micro.hbchen.com/greeting/call?msg=helloworld"
```