-
首先在 Amnibus-CaaS 平台上使用 SpringCloud-Eureka 模板创建服务发现与注册组件 Eureka,
Eureka Route HostName
建议按 eureka.${apps_dns_domain} 规则填写。 -
测试 Eureka 服务是否正常:
$ curl https://eureka.${apps_dns_domain}/health {"description":"Composite Discovery Client","status":"UP"}
-
创建服务提供者 microservice-provider-user
eureka.client.serviceUrl.defaultZone
需要对应已经创建好的 Eureka 服务,即https://eureka.${apps_dns_domain}/eureka
$ oc apply -f microservice_provider_user_configmap.yaml $ oc apply -f microservice_provider_user_deployment.yaml $ oc scale deployment microservice-provider-user-deployment --replicas=3
-
创建服务消费者 microservice-consumer-movie
同样
eureka.client.serviceUrl.defaultZone
需要对应已经创建好的 Eureka 服务,即https://eureka.${apps_dns_domain}/eureka
$ oc apply -f microservice_consumer_movie_configmap.yaml $ oc apply -f microservice_consumer_movie_deployment.yaml $ oc apply -f microservice_consumer_movie_service.yaml
-
测试消费者是否成功从 Eureka 获取服务提供者
$ curl http://microservice-consumer-movie.default.svc.cluster.local/user/1 {"id":1,"username":"account1","name":"张三","age":20,"balance":100.00} $ curl http://microservice-consumer-movie.default.svc.cluster.local/user/2 {"id":2,"username":"account2","name":"李四","age":28,"balance":180.00} $ curl http://microservice-consumer-movie.default.svc.cluster.local/user/3 {"id":3,"username":"account3","name":"王五","age":32,"balance":280.00}
lab-openshift's Introduction
lab-openshift's People
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.