Skip to content

A Python 3 Flask project which provides a simple web ui for an open source dadjokes generator

License

Notifications You must be signed in to change notification settings

mshdg/dadjoke-ui

Repository files navigation

Dad Jokes Web UI

Build Status GitHub release (https://github.com/jaysgrant/dadjoke-ui/releases) LGTM Grade GitHub Docker Pulls

A simple Python 3 Flask based web UI for the Dad Jokes microservice project. The project is built around the idea of deployment hosted on Docker, and Kubernetes.

Getting Started

See the deployment examples within the examples folder.

Kubernetes

The Kubernetes example deployes two services, and two deployments.

DadJokes Microservice

  • Creation of a service, and deployment of the DadJokes Microservice to generate the jokes.
  • Service creation with a type of NodePort.

DadJokes Web UI

  • Creation of a service, and deployment of the DadJokes UI, providing a web view of the output of the DadJokes Microservice.
  • Service creation with a type of NodePort.

Installation on Kubernetes

See the Kubernetes examples provided.

Docker

See the docker-compose example provided.

Observability

The Kubernetes/loadbalancer example has the UWSGI stats server enabled. The deployment will include a sidecar container for the UWSGI Exporter to allow exporting metrics to Prometheus on the performance of UWSGI.

The service created for the load balancer includes exposing the UWSGI stats over port 9117 via http. This configuration can be used to allow Prometheus to scrape metrics. A simple example of a Prometheus scrape job setup would be as follows:

  - job_name: 'uwsgi'
    static_configs:
         - targets:
           - '192.168.1.53:9117'

This is a very simple configuration, with a static job, that scrapes the metrics from the loadbalancer located at IP 192.168.1.53 via port 9117.