View on GitHub

testFlask

Python Flask Application for Openshift 4 Example/Demo

testFlask

Test Flask is a simple flask application to show some parts of the OpenShift Application Experience for a Python Application. It’s been broken down into a series of modules that cover likely Use Cases.


Modules

Module 1: testFlask - Main Application(This Page)

  1. s2i Build
  2. Git Webhooks
  3. Openshift Health Checks
  4. Horizontal Autoscaling
  5. Vertical Autoscaling
  6. User Workload Monitoring
  7. Serverless Example
  8. Async Python Example

Module 2: Custom s2i Images - Create Custom s2i Images for Python Applications

Module 3: testFlask-Jenkins - Create Same Application with a Jenkins Pipeline in OpenShift

Module 4: testFlask-Tekton - Create Same Application with a Tekton Pipeline in OpenShift

Module 5: testFlask-Oauth - Application authentication using OpenShift Oauth Proxy

Module 6: testflask-gitops - ArgoCD Application Continous Deployment

Module 7: testflask-helm-repo - Deploy the Same Application via Helm

Module 8: python-openshift-remote-debugging-vscode-example - Remote Debugging Application

Steps to Build and Run Application

Webhooks

Health Checks

Horizontal AutoScaling with CPU/Memory

Let’s horizonatally autoscale based on Pod CPU Metrics.

Vertical Pod Autoscaler

Let’s vertically autoscale based on Pod CPU Metrics.

Monitoring and AutoScaling Application Metrics

Openshift also provides a way for you to use Openshift’s platform monitoring to monitor your application metrics and provide alerts on those metrics.Note, this functionality is still in Tech Preview.This only works for applications that expose a /metrics endpoint that can be scraped which this application does. Please visit Monitoring Your Applications and you can see an example of how to do that here, before running any of the below steps please enable monitoring using info from the links above.

OpenShift Serverless

Openshift provides serverless functionality via the Openshift serverless operator, Follow steps in documenation to create serveless installation**

ASGI/Quart/Uvicorn

Build and Alternate version of the testflask application using ASGI and Uvicorn**