Git Product home page Git Product logo

django_postgresql_kubernetes's Introduction

django-postgresql-kubernetes

This is a Django, with database PostgreSQL Docker/ Kubernetes cluster

django_kubernetes

Django application deployed with Kubernetes

To run the web app locally

First install the dependencies

    pip install -r requirements.txt

To start the django app locally

  python manage.py runserver

Go to url

http://localhost:8000

Django-app deployment in kubernetes

To start the docker-container use command>

docker-compose up

The app starts at port number 8020

http://localhost:8020

Use Kubernetes to deploy enviornmental variables used by web-app

kubectl apply -f ./kubernetes/secret.yml
kubectl create -f ./kubernetes/config_map.yml

Use Kubernetes to create persistan-volume, persistant-volume-claim deployment and service resources for database

kubectl apply -f ./kubernetes/postgre/component_postgre.yml

To check the status of pods:

kubectl get pod

To check the service

kubectl get service

Use Kubernetes to create deployment and service resources for django app

kubectl apply -f ./kubernetes/django/component_postgre.yml

Running the app using an external ip address

minikube get service django-rest-service --url

Running the app using ingress

start the ingress controller

minikube addons enable ingress

To view the ingress resources

minikube get pods -n ingress-nginx

makesure to map the host name to minikube IP in /etc/host file

In this case that shall be

minikube_IP django.postgre.com

Use Kubernetes to create ingress resources for django app

kubectl apply -f ./kubernetes/ingress_service.yml

django_postgresql_kubernetes'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.