Git Product home page Git Product logo

ticket-monster-ui's Introduction

Ticket Monster UI

First we need to build the docker container.

Vanilla Kubernetes

If you're running on vanilla Kubernetes (or some distro that doesn't do docker builds) then you need access to a docker Daemon. To build navigate into the web folder and run the docker build:

cd web
docker build -t ticketmonster/ui:2.0 .

If your kubernetes isntallation is not local, you'll need to tag and push the image to a docker registry that can be reached by your Kubernetes installation. Once you've pushed it to a docker registry, run like this:

kubectl run tm-ui --image=ticketmonster/ui:2.0

Now expose the UI as a Kuberentes Service:

kubectl expose rc tm-ui-1 --name ticket-monster --port 80

Lastly, you'll need to expose a Kubernetes Ingress route. See the docs on Ingress Resources for more.

Running on OpenShift 3.x

OpenShift makes a lot of this a lot easier for these reasons:

  • we can do the docker build inside of openshift with BuildConfigs; we don't need access to a docker daemon
  • openshift has an out of the box integrated docker registry; don't need to find one that's accessible to our Kubernetes installation

Let's try it. First we need to build the docker image. Navigate to web folder and ask openshif to do the build:

oc new-build --binary=true --name ticket-monster-ui
oc start-build ticket-monster-ui  --from-dir=.

Now, let's create the application and deploy it:

oc new-app ticket-monster-ui
oc deploy ticket-monster-ui

NOTE: the default security context constraints enforce certain assumptions about the Docker image for security reasons. At the moment, we cannot run as root out of the box inside the Docker image (and bind to port 80). To alleviate this for the purposes of this example, let's edit the restricted scc and allow to RunAsAny user:

export EDITOR=vim
oc edit scc restricted

Change the runAsUser section to match:

 runAsUser:
   type: RunAsAny

In OpenShift, we can expose this as a route (similar to Kubernetes Ingress). Here's an example:

oc expose svc ticket-monster-ui

Now we should be able to hit the service from the command line or the browser based on the OpenShift Route or Kubernetes Ingress!

Set up the backend services

The backend services should be listening at:

Please see the httpd.conf file for more.

Additonal notes: Can port forward to your local machine from vagrant like this:

vagrant ssh -- -vnNTL *:8080:$DOCKER_HOST_IP:8080

ticket-monster-ui's People

Contributors

christian-posta avatar

Watchers

James Cloos avatar Marcelo Vicente Pesenti Fachinelli 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.