Coder Social home page Coder Social logo

ibm / visitor Goto Github PK

View Code? Open in Web Editor NEW
1.0 5.0 1.0 173 KB

This repository is for visitor microservice.

License: Creative Commons Zero v1.0 Universal

Dockerfile 6.18% Smarty 23.18% Shell 8.90% Java 61.74%
helm-charts helm3 spring-boot r4j kubernetes

visitor's Introduction

Hybrid chart approach with Helm Charts in Openshift

This approach means to create one 'leader' chart per service group, while keeping one dependent chart per service, having values and specific aditions.

Goal of this section: deploy the visitor and landmark microservices using Helm charts.

Leader chart approach will be used for deploying landmark microservice, while visitor microservice will be deployed via chart per service approach.

All the below commands will be executed in a terminal window.

Preparation

To login to the OpenShift cluster from the Terminal run:

$ oc login -u kubeadmin -p YOUR_SECRET_PASSWORD https://api.crc.testing:6443

Check if you already have the dev project:

$ oc get project
$ oc new-project dev
$ oc project dev

The landmark microservice will persist its data into a database, in this case a PostgreSQL database instance.

Check if the Helm repo https://charts.bitnami.com/bitnami is added to your existing list:

$ helm repo list

If the repo is not there, please run the following set of commands:

$ helm repo add bitnami https://charts.bitnami.com/bitnami

Working locally with the Docker image for Visitor Microservice

Clone the repository https://github.com/IBM/visitor. Try to build the project locally using Run-Visitor-Microservice.adoc.

If you wish to build the image locally, please use:

$ docker run -d -p 5000:5000 --restart=always --name registry registry:2
$ docker build -t springboot/visitor:1.0 .
$ docker tag springboot/visitor:1.0 localhost:5000/springboot/visitor:1.0
$ docker push localhost:5000/springboot/visitor:1.0

Install leader chart for Landmark microservice

If you have not deployed the landmark microservice using leader chart approach, please execute the following:

$ git clone https://github.com/IBM/landmark.git
$ git checkout solution/leader-chart-lab
$ git pull

NOTE: Do the bellow steps only if you do not have the landmark Docker image created yet.

Working locally with the Docker image for Landmark Microservice

Clone the repository https://github.com/IBM/landmark. Try to build the project locally using Run-Landmark-Microservice.adoc.

Make sure that you are under root folder of the clone repository (landmark) and run:

$ mvn package

Then, build the image with:

$ docker run -d -p 5000:5000 --restart=always --name registry registry:2
$ docker build -f Dockerfile -t spring-boot/visitor:1.0 .
$ docker tag spring-boot/visitor:1.0 localhost:5000/spring-boot/visitor:1.0
$ docker push localhost:5000/spring-boot/visitor:1.0

Leader Helm chart setup

Install your charts in your current project:

$ helm install leader ./leader
$ helm status leader

Install Helm chart for Visitor microservice

Return to the root folder of visitor microservice (visitor) and install its Helm charts:

$ cd chart
$ helm install visitor ./visitor
$ helm status visitor
$ kubectl get ns
$ kubectl get svc
$ kubectl port-forward --namespace qa svc/visitor 8080

Go in a browser window and copy-paste http://localhost:8080/api/visit/museum/ams

Congratulations, you visited a landmark by using two microservices!

Compatibility

The Java code in the repositories is compatible with Java11.


License

This code is dedicated to the public domain to the maximum extent permitted by applicable law, pursuant to CC0.

visitor's People

Contributors

ammbra avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

ghas-results

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.