GithubHelp home page GithubHelp logo

djones6 / quarkus-coffeeshop-demo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ianpartridge/coffeeshop-demo

0.0 0.0 0.0 111 KB

Quarkus, Kafka and Reactive are ordering coffee

License: Apache License 2.0

Java 37.11% HTML 8.51% Shell 32.62% Lua 0.18% Dockerfile 5.70% Batchfile 5.07% Smarty 1.75% Go 9.06%

quarkus-coffeeshop-demo's Introduction

Reactive Coffeeshop Demo

This is a demo of a reactive system built with Liberty, Kafka and Keda.

Run locally in containers using Docker Compose

To perform a simple local run of the demo, use:

docker-compose up

...wait until the 'ready' stage completes (with the message coffeeshop-service is ready!), then order coffees at http://localhost:8080/

Run with Strimzi and Keda, using Helm

The Coffeeshop demo and its prerequisites can be installed into a Kubernetes cluster using Helm (v3).

Prereqs

  • Install Helm v3: https://helm.sh/docs/intro/install/
  • Ensure you have a Kubernetes cluster. For running locally, you could use:
    • Docker Desktop on Windows or Mac,
    • Minikube, or
    • kind.
    • Kind is nice because it's quick and easy to create / teardown a temporary cluster, but there are a couple of additional steps required if you want to use it. Take a look at the Travis job (which uses kind) for details.

Installing

You can install everything using Helm by running the supplied install.sh (or install.bat) script. Removal can be performed with uninstall.sh / uninstall.bat.

To install manually, the steps are:

  1. Install the Strimzi operator
kubectl create ns strimzi
kubectl create ns kafka
helm repo add strimzi https://strimzi.io/charts
helm install strimzi strimzi/strimzi-kafka-operator -n strimzi --set watchNamespaces={kafka} --wait --timeout 300s
  1. Install the custom resource to create a Kafka
kubectl apply -f kafka-strimzi.yml -n kafka
kubectl wait --for=condition=Ready kafkas/my-cluster -n kafka --timeout 180s
  1. Install the Keda operator
kubectl create ns keda
helm repo add kedacore https://kedacore.github.io/charts
helm install keda kedacore/keda -n keda --wait --timeout 300s
  1. Install coffeeshop chart
kubectl create ns coffee
helm install coffee-v1 ./coffeeshop-chart -n coffee --wait --timeout 300s

Once installed, you can access the service either using the NodePort, or you can set up port forwarding:

kubectl port-forward service/coffee-v1-coffeeshop-service 8080:8080 -n coffee

Obtaining the node IP and port

If installing to a remote cluster, the postinstall.sh (and postinstall.bat) script will query Kubernetes to obtain the external IP and NodePort and provide you with the corresponding coffeeshop URL. This is run at the end of the provided install script.

Validating

You can validate that the install is successful using the ci-test.sh script (that is used by the Travis job):

./ci-test.sh 8080 coffee
  • if using the NodePort, substitute the port number instead of 8080 above.

Testing

Access the coffeeshop dashboard in a web browser, either using the cluster IP and node port or by port forwarding as described above.

You can order coffees via either the HTTP or Kafka baristas. When ordering using the Kafka barista, there will be a short delay the first time while the barista starts. If you order several coffees, Keda will scale up the baristas and you should see coffees prepared by multiple baristas.

Upgrades

If you have changed something in the chart:

helm upgrade coffee-v1 ./coffeeshop-chart -n coffee

Removal

If you want to clear out everything that was created by the chart, either use the uninstall.sh, or:

helm uninstall coffee-v1 -n coffee
kubectl delete ns coffee

helm uninstall keda -n keda
kubectl delete ns keda

kubectl delete -f kafka-strimzi.yml -n kafka
kubectl delete ns kafka

helm uninstall strimzi -n strimzi
kubectl delete ns strimzi

Keda seems to leave some artifacts around even after the chart has been uninstalled. To clean these up:

kubectl delete apiservice v1alpha1.keda.k8s.io
kubectl delete crd scaledobjects.keda.k8s.io
kubectl delete crd triggerauthentications.keda.k8s.io

quarkus-coffeeshop-demo's People

Contributors

cescoffier avatar djones6 avatar matthewpwilson avatar kenfinnigan avatar emmanuelbernard avatar tqvarnst 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.