Giter Club home page Giter Club logo

kube's Introduction

Flask Application Deployed using Terraform on a cluster (minikube)

Flask application to deploy the zero downtime app on the cluster

Prerequisites

Before getting started, ensure you have the following installed:

  • Docker
  • kubectl utility

Getting Started

Follow these steps to run the Flask application locally using Docker:

  1. Clone the Repository:

    git clone <repository-url>
    cd <repository-folder>
    
  2. Build Docker for you application:

  • Build a Dockerfile for you app
  • Build docker image
docker build -t <image_name>:<tag_name> .
  1. Config changes:
  • Replace the image name in the app deployment resource. (This should ideally be more modularised. You should be able to give all info to terraform in the config file.)
  • MySql Connections: # Replace these fields from terraform/db/main.tf config resource This should ideally be more modularised. You should be able to give all info to terraform in the config file.
  • Push it to a repository like DockerHub (push it to minikube in case of local cluster)
  1. Run terraform code to deploy app, its corresponding db, prometheus and fluentd:

     terraform plan
     terraform apply

    You can run kubectl commands to check that all service, deployment, pods, ingress are running as expected.

Notes:

  1. I have also created terraform code to deploy Jenkins.
  2. This is a basic module. A lot of necessary improvements on security practices and modularising can be done.
    • Storing the tfstate in S3.
    • Modularising tf code
    • Setting up non root for various application such as Docker, mysql etc.
    • Writing better and more test cases covering all tests.

kube's People

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.