All Projects → AnjaneyuluBatta505 → kubernetes_django

AnjaneyuluBatta505 / kubernetes_django

Licence: MIT license
Deploying django application on kubernetes

Programming Languages

python
139335 projects - #7 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to kubernetes django

Kubernetes Workshop
⚙️ A Gentle introduction to Kubernetes with more than just the basics. 🌟 Give it a star if you like it.
Stars: ✭ 3,122 (+14090.91%)
Mutual labels:  kubernetes-service, kubernetes-deployment
sbt-kubeyml
Sbt plugin to help deploy Scala applications to Kubernetes
Stars: ✭ 37 (+68.18%)
Mutual labels:  kubernetes-service, kubernetes-deployment
terraform-aws-eks
A Terraform module to Provision AWS Elastic Kubernetes (EKS) clusters and worker nodes
Stars: ✭ 57 (+159.09%)
Mutual labels:  kubernetes-deployment
spring-cloud-microservices-on-kubernetes
My Best Practices in development and deployment of Spring Cloud Microservices on Kubernetes.
Stars: ✭ 19 (-13.64%)
Mutual labels:  kubernetes-deployment
django-step-by-step
A Django + Vue reference project that focuses on developer tooling and CI/CD + IaC
Stars: ✭ 86 (+290.91%)
Mutual labels:  celery
myblog
An Open Source Multi-user Blog System that Powered by Flask.
Stars: ✭ 19 (-13.64%)
Mutual labels:  celery
funboost
pip install funboost,python全功能分布式函数调度框架,。支持python所有类型的并发模式和全球一切知名消息队列中间件,python函数加速器,框架包罗万象,一统编程思维,兼容50% python编程业务场景,适用范围广。只需要一行代码即可分布式执行python一切函数。旧名字是function_scheduling_distributed_framework
Stars: ✭ 351 (+1495.45%)
Mutual labels:  celery
logtoes
Demo of Asynchronous pattern (worker) using Python Flask & Celery
Stars: ✭ 49 (+122.73%)
Mutual labels:  celery
Final-Senior-Year-Project-
My College Final(Senior) Year Project
Stars: ✭ 98 (+345.45%)
Mutual labels:  celery
fastapi
基于Fastapi开发,集成Celery-redis分布式任务队列、JWT 用户系统、ElasticSearch和encode orm的基础项目模板,大家可以根据自己的需求在本模板上进行修改
Stars: ✭ 75 (+240.91%)
Mutual labels:  celery
docker-flask-example
A production ready example Flask app that's using Docker and Docker Compose.
Stars: ✭ 311 (+1313.64%)
Mutual labels:  celery
mango
Parallel Hyperparameter Tuning in Python
Stars: ✭ 241 (+995.45%)
Mutual labels:  kubernetes-deployment
ansible-role-rke2
Ansible Role to install RKE2 Kubernetes.
Stars: ✭ 118 (+436.36%)
Mutual labels:  kubernetes-deployment
python react blog back end
Redis Celery Fabric Gunicorn Personal Blog
Stars: ✭ 12 (-45.45%)
Mutual labels:  celery
monokle
🧐 Monokle streamlines the process of creating, analyzing, and deploying Kubernetes configurations by providing a unified visual tool for authoring YAML manifests, validating policies, and managing live clusters.
Stars: ✭ 795 (+3513.64%)
Mutual labels:  kubernetes-deployment
fastapi-celery-redis-rabbitmq
A simple docker-compose app for orchestrating a fastapi application, a celery queue with rabbitmq(broker) and redis(backend)
Stars: ✭ 81 (+268.18%)
Mutual labels:  celery
withme3.0
Using Netty as the server and WebSocket as the communication protocol, the instant messaging system developed by microservice architecture is adopted.
Stars: ✭ 66 (+200%)
Mutual labels:  kubernetes-deployment
cell
actor framework for Kombu
Stars: ✭ 73 (+231.82%)
Mutual labels:  celery
DeadPool
该项目是一个使用celery作为主体框架的爬虫应用,能够灵活的添加爬虫任务,并且同时运行多站点的爬虫工作,所有组件都能够原生支持规模并发和分布式,加上celery原生的分布式调用,实现大规模并发。
Stars: ✭ 38 (+72.73%)
Mutual labels:  celery
metroid
Metroid - Metro for Django (An async Azure Service Bus receiver, triggering task in Celery/RQ)
Stars: ✭ 27 (+22.73%)
Mutual labels:  celery

Django application deployment in kubernetes

To get started with kubernetes in local environment use Microk8s. Go through the microk8s setup documentation and setup it.

Adding alias to "microk8s.kubectl" to "k8s"

Open ~/.bashrc and below line at the end of the file.

alias k8s="microk8s.kubectl"

Now, clone this repo using below commands

git clone [email protected]:AnjaneyuluBatta505/kubernetes_django.git

Let's start the deployment of the django application and other apps like redis, postgres, flower, etc.

Setting up postgres service

In the postgres we have 4 yaml configuration files.

  1. secrets.yaml - Useful when using secret env vaibles in the apps
  2. volume.yaml - Persistent Volume for Postgres database
  3. volume_claim.yaml - This claim lets our deployment application store its data in an external location, so that if one of the application’s containers fails, it can be replaced with a new container and continue accessing its data stored externally, as though an outage never occurred.
  4. deployment.yaml - Deployment to start the application containers
  5. service.yaml - Allows other apps to comminicate with it's related deployment(i.e pods/containers)

Now, create above objects in kubernetes using below commands

k8s apply -f kubernetes/postgres/secrets.yaml
k8s apply -f kubernetes/postgres/volume.yaml
k8s apply -f kubernetes/postgres/volume_claim.yaml
k8s apply -f kubernetes/postgres/deployment.yaml
k8s apply -f kubernetes/postgres/service.yaml

We have successfully created the postgres service in k8s(i.e kubernetes cluster).

Setting up redis service

In the redis we have 2 yaml configuration files. To setup the redis service in k8s execute the below commands

k8s apply -f kubernetes/redis/deployment.yaml
k8s apply -f kubernetes/redis/service.yaml

Setting up django app

In django app we have 3 yaml configuration files. To setup the django app in k8s execute the below commands

k8s apply -f kubernetes/django/job-migration.yaml
k8s apply -f kubernetes/django/deployment.yaml
k8s apply -f kubernetes/django/service.yaml

Setting up celery app

In celery app we have 2 yaml configuration files. To setup the django app in k8s execute the below commands

k8s apply -f kubernetes/celery/beat-deployment.yaml
k8s apply -f kubernetes/celery/worker-deployment.yaml

Setting up flower app

In flower app we have 2 yaml configuration files. To setup the django app in k8s execute the below commands

k8s apply -f kubernetes/flower/deployment.yaml
k8s apply -f kubernetes/flower/service.yaml

How to debug the pods for errors if any failures occurs ?

$ k8s get po
NAME                             READY   STATUS      RESTARTS   AGE
celery-beat-75b5f954-m2pzj       1/1     Running     0          64m
celery-worker-56fc7b88f5-shd87   1/1     Running     0          61m
django-688f76f576-kt4h6          1/1     Error       0          60m
django-migrations-mhng7          0/1     Completed   0          59m
flower-77bf99c799-9drnp          1/1     Running     87         20h
postgres-76dc76ffbb-hzmdc        1/1     Running     2          23h
redis-76f6f4857b-srxlw           1/1     Running     1          20h

We can debug the pod failure using command k8s logs <pod name>. Sometimes k8s describe <name of k8s object>

To access the django app in our local browser

$ k8s get svc
NAME               TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)          AGE
django-service     NodePort    10.152.183.146   <none>        8000:32693/TCP   21h
flower-service     NodePort    10.152.183.170   <none>        5555:30675/TCP   21h
kubernetes         ClusterIP   10.152.183.1     <none>        443/TCP          25h
postgres-service   ClusterIP   10.152.183.151   <none>        5432/TCP         24h
redis-service      ClusterIP   10.152.183.89    <none>        6379/TCP         21h

Visit url "10.152.183.146:8000" (i.e CLUSTER-IP:PORT). It's just for testing.

References:

  1. https://microk8s.io/docs/
  2. https://kubernetes.io/docs/home/
  3. https://medium.com/edureka/what-is-kubernetes-container-orchestration-tool-d972741550f6
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].