Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nhatthaiquang-agilityio/django-postgres-minikube
Deploy Django and Postgres on Minikube
https://github.com/nhatthaiquang-agilityio/django-postgres-minikube
django kubernetes minikube postgres
Last synced: 19 days ago
JSON representation
Deploy Django and Postgres on Minikube
- Host: GitHub
- URL: https://github.com/nhatthaiquang-agilityio/django-postgres-minikube
- Owner: nhatthaiquang-agilityio
- Created: 2018-12-11T03:03:00.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-12-12T09:27:02.000Z (about 6 years ago)
- Last Synced: 2024-04-16T07:09:37.664Z (9 months ago)
- Topics: django, kubernetes, minikube, postgres
- Language: Python
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# django-postgres-minikube
Deploy Django app and Postgres on Minikube# Requirements
+ [Install Docker](https://docs.docker.com/engine/installation/)
+ Minikube
+ Django 1.9.7
+ Postgres 9.5# Run command
## Build Django Image
#### Build Base Image: Django and Python3.6
$ cd django-postgres-minikube/devops
$ docker build -t nhatthai/python3.6_django .#### Build App:
$ cd backend
$ docker build -t nhatthai/django-postgres .#### Push to Docker Hub
docker push nhatthai/django-postgres:latest### Start Minikube
$ minikube start### Create ConfigMap
$cd devops/manifest
$kubectl create -f configmap.yml### Create Deployment Postgres
$ cd devops/manifest
$ kubectl create -f postgres/deployment.yml### Create Service Postgres
$ cd devops/manifest
$ kubectl create -f postgres/service.yml### Create Deployment
$ cd devops/manifest
$ kubectl create -f django/deployment.yml### Create Service
$ cd devops/manifest
$ kubectl create -f django/service.yml### Check Servive and run Command
$kubectl exec -it web-service /bin/bash#### Create Super User
python manage.py createsuperuser#### Run Server
root@web-service:#python manage.py runserver 0.0.0.0:8000### Ingress
#### Create Ingress
$ cd devops/manifest
$ kubectl create -f ingress.yml#### Check Ingress status
kubectl describe ing#### Start Ingress on Minkube
$ minikube addons enable ingress#### Get IP
$ minikube ip
192.168.99.100#### Add mysite.com into /etc/hosts
192.168.99.100 mysite.com#### Check Django App
http://mysite.com/admin/# Reference
[Writing your first Django App](https://docs.djangoproject.com/en/2.1/intro/tutorial01/)