Giter VIP home page Giter VIP logo

felfel-taskwork's Introduction

FELFEL Task Work (Edwin Hermans)

This project handles the running of a basic dockerized Python Flask app using Redis.

The project is to show understanding of Docker, Kubernetes and peripheral systems.

It consists of:

  • a simple Python Flask app, provided by FELFEL with minor modifications by applicant
  • requirements.txt and Dockerfile to build docker container
  • Docker Compose compose.yml for local testing
  • Kubernetess resource definitions for Deployment, Service and Ingress in ./k8s and shell script to deploy resources

How to run locally

To run the application locally we'll need to install the dependencies and have a running redis data store available. We'll make it simple by using Docker Compose to handle these steps for us.

Docker Compose will build the docker container image if it's not yet available and spin up a redis container and the application container.

docker compose up

(add -d after up if you want the process to detach and not connected to the foreground shell)

After the application starts up you can browse to http://localhost:8080 to see it in action. When you refresh the page the count should increase. You can also browse to

To stop and remove the containers run:

docker compose down

When you bring up the compose setup once more you'll notice the count has reset to 0.

How to run on Kubernetes

There are k8s resource definitions provided in the ./k8s directory for a Deployment and connected Service and Ingres types. Deploy to Kubernetes using the deploy_k8s_local.sh script.

deploy_k8s_local.sh

If your local k8s instance has the NGINX ingress controller deployed, you should be able to browse to http://felfel-taskwork.127.0.0.1.nip.io which is a special DNS record that resolves to 127.0.0.1 and will connect to your local k8s instance. Without the NGINX ingress controller available, please use a port-forward to connect to the application like so:

kubectl port-forward $(kubectl get pods -l "app=felfel-taskwork" -o jsonpath="{.items[0].metadata.name}") 8080

Then browse to http://localhost:8080, just like with the Docker Compose setup.

Prometheus metrics will be collected based on the k8s resource annotations so no further configuration steps need to be taken.

To clean up the resources run:

deploy_k8s_local.sh delete

felfel-taskwork's People

Contributors

madeddie avatar dependabot[bot] avatar

Watchers

 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.