Coder Social home page Coder Social logo

marthydavid / docker-java-sample-webapp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sbcd90/docker-java-sample-webapp

0.0 1.0 0.0 11 KB

A simple java webapp + docker + docker-compose + kubernetes exploration project

Java 48.96% Smarty 37.00% Dockerfile 14.04%

docker-java-sample-webapp's Introduction

docker-java-sample-webapp

Problems with OpenShift 3.10.

  • Without proper ServiceAccount configuration the pod never started with mounted/env used secrets.
  • Haproxy-Route url rewrite capability missing.
  • Haproxy-Route missing 80 to 443 redirect.
  • Missing logging, monitoring for pods.

Files:

  • src/main/docker/Dockerfile used for building the container
  • kubernetes.yaml file for deploying the app with predefined ingress host and secret

Usage

Edit kubernetes.yml with the correct url and secret name then: kubectl apply -f kubernetes.yaml Or install it with helm it's located under src/main/kubernetes/helm-chart

Test it:

Check if pod is running:

  • kubectl get pods --field-selector=status.phase=Running -l app=java-sample
  • kubectl run -i -t busybox --image=busybox --restart=Never
  • curl -v http://java-sample:8080/?name=World
  • curl -v http://java-sample:8080/docker-java-sample-webapp-1.0-SNAPSHOT?name=World

Check if rewrite is working through ingress

  • export INGRESS_URL=$(kubectl get ingress pod-service -ojsonpath='{.spec.rules[*].host}')
  • curl -vL http://$INGRESS_URL/?name=World or open http://$INGRESS_URL/?name=World
  • curl -vL http://$INGRESS_URL/docker-java-sample-webapp-1.0-SNAPSHOT?name=World or open http://$INGRESS_URL/docker-java-sample-webapp-1.0-SNAPSHOT?name=World

docker-java-sample-webapp's People

Contributors

sbcd90 avatar marthydavid 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.