Giter Site home page Giter Site logo

williamcaban / podcool Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 2.0 1.27 MB

Simple app to demo OKD or OpenShift features like s2i (src/docker/image) deployment, split traffic, multus, rolling deployments, A/B testing, Blue/Green deployments and other capabilities.

Dockerfile 9.63% Makefile 6.39% Python 52.66% HTML 31.32%
openshift okd kubernetes

podcool's Introduction

Docker Repository on Quay

Demo Application Used to Showcase Multiple OpenShift Concepts

This repository provides a sample Python web application implemented using the Flask web framework. It is intended to be used to demonstrate a variety of capabilities of OpenShift 3.11 and higher. The base functionality should work in prior versions but this has not been tested.

This app can be used to demonstrate the following OpenShift features or capabilities:

  • s2i
    • source strategy
    • Dockerfile/docker strategy
    • Image strategy
  • Blue/Green deployments
  • Canary deployments
  • OpenShift Service Mesh (Maistra: Istio, Envoy, Kiali, Jaeger, Grafana, Prometheus)
  • OpenShift Multinetwork (Multus) [dev preview]

Requirements

To test this apps you will need an OpenShift or OKD environment.

Using the application

The application understand the following environment variables

  • APP_VERSION
  • APP_MESSAGE

The values of these variables are displayed as the application version and as a generic message accordingly.

  • APP_VERSION between v1 to v12 will display a background image
  • APP_VERSION with value of "Blue" or "Green" will display a solid Blue or Green background
  • APP_VERSION with any other value will display a solid white background.

Using the basic funcitonalities of the demo app:

APP ROUTES FUNCTIONALITY USE CASES
/ Display a simple web interface with the name of the Pod, APP_VERSION and APP_MESSAGE information. This can be used to demo from a browser
/hello Return a single liner text version of the Pod name and APP_VERSION. This can be used to demo from a curl command or similar
/healthz Return a JSON formatted status of the app, the container name and container version. This can be used for health checks or pod readiness checks
/net Return a JSON formatted list of the network interfaces seen by the pod. This can be used to demo Multus/OpenShift Multinetwork functionalities.
/net/<ifname> Return a JSON formatted list of IPv4 addresses of ifname Pod interface. This can be used to demo Multus/OpenShift Multinetwork functionalities.
/ping/<dhost> Return a JSON formatted list tcp_ping result to port 80 of dhost. This can be used to demo Istio and Multus/OpenShift Multinetwork functionalities.
/ping/<dhost>/<dport> Return a JSON formatted list tcp_ping result to port dport of dhost. This can be used to demo Istio and Multus/OpenShift Multinetwork functionalities.

DEMOS & LABS

Some demos and labs that use this application are available at https://github.com/williamcaban/podcool-docs

  • Deploying an App using the Developer Console
  • Deploying an App using the OpenShift Client CLI
  • Testing Pod Resiliency
  • Deployment Strategies
  • Splitting Traffic
  • CI/CD Pipelines
  • Quay Enterprise Registry
  • OpenShift Service Mesh [Tech Prev] -- (Maistra, Isitio, Envoy, Kiali, Prometheus, Grafana, Jaeger)
  • OpenShift Multi-network [Dev Prev] -- (Multus)

Using a Minishift Environment

If using Red Hat CDK you can start OpenShift (Minishift) with the following command:

$ minishift start
oc login -u developer

Some additional Minishft commands if considering the use of privileged containers.

NOTE: THESE ARE NOT REQUIRED FOR THIS DEMO BUT GOOD TO KEEP IN MIND FOR DEMO ENVIRONMENTS

oc adm policy add-scc-to-group anyuid system:authenticated
$ minishift addons enable anyuid
$ minishift addons enable admin-user
$ minishift start --ocp-tag v3.11.16

To explore additional Minishift addons

$ minishift addons list

Additional details about Minishift can be found at

Implementation Notes

This sample Python application relies on the support provided by the default S2I builder for deploying a WSGI application using the gunicorn WSGI server. The requirements which need to be satisfied for this to work are:

  • The WSGI application code file needs to be named wsgi.py.
  • The WSGI application entry point within the code file needs to be named application.
  • The gunicorn package must be listed in the requirements.txt file for pip.

In addition, the .s2i/environment file has been created to allow environment variables to be set to override the behaviour of the default S2I builder for Python.

The environment variable APP_CONFIG has been set to declare the name of the config file for gunicorn .

podcool's People

Contributors

williamcaban avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

marhatha bpayton

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.