Code Monkey home page Code Monkey logo

lab-openshift's Introduction

lab-openshift

SpringCloud

  1. 首先在 Amnibus-CaaS 平台上使用 SpringCloud-Eureka 模板创建服务发现与注册组件 Eureka,Eureka Route HostName 建议按 eureka.${apps_dns_domain} 规则填写。

  2. 测试 Eureka 服务是否正常:

    $ curl https://eureka.${apps_dns_domain}/health
    {"description":"Composite Discovery Client","status":"UP"}
  3. 创建服务提供者 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
  4. 创建服务消费者 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
  5. 测试消费者是否成功从 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 People

Contributors

crazytaxii avatar wu-wenxiang avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.