Git Product home page Git Product logo

labs_challenge's Introduction

My Labs Challenge

API Docs (for routes not documented in challenge)

Route Method Data Return
/scrape GET N/A Sucess if scrape was successful
/api/clubs POST JSON list (parameter data) with maps containing name :: string,description :: string, tags :: string list Success if addition was successful
/ascii GET String (parameter image-url) containing a HTTP-only url of an image That image in ASCII art

Info on my setup

This is all hosted at https://labs.walthome.duckdns.org/

Django

This Django boilerplate is taken from the template-django repository and modified appropriately.

Docker

I then used the django-base repo to build a docker image. There was just one problem. Armaan only half-finished the repo. I made a few pull requests and now the thing's finished(ish). It has some problems with serving static files in prod, but I'm working on it. In the words of Armaan, "I have no idea why this isn't working." Same.

Kubernetes

I then made a deployment file and deployed it to my Kubernetes cluster. This cluster is in my homelab created using some automated deployment files I created. Because the whole deploy process is automated, I could kill the entire cluster and recreate it in minutes with no repercussions.

Database

I then used KubeDB to create a mysql manifest and applied it. Then, I pulled out the credentials from the secret KubeDB created and created a DATABASE_URL secret. I attached the DATABASE_URL secret to the main deployment, and we're all done!

Why

You may be asking "Why are you deploying this on Kubernetes? That seems way too complicated." If you only consider this project, you're absolutely right. It would be foolish to create a cluster only to host this project. However, the value from Kubernetes comes as I create more and more projects like this. Each new project is just a simmple deploy file. With that one deploy file, I get replication, automatic SSL, and easy orchestration.

Also, you might be wondering why I'm using KubeDB rather than a DB hosted on a VM. The reasoning is basically the same as why I'm doing the deploy on Kubernetes. I hate making new VMs and spinning up new databases. I'd much rather just make a KubeDB manifest.

labs_challenge's People

Stargazers

 avatar

Watchers

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