This is Django Starter Template which will be used in GitOps demo using ArgoCD.
-
Docker - Docker helps developers bring their ideas to life by conquering the complexity of app development.
-
Kubernetes - also known as K8s, is an open-source system for automating deployment, scaling, and management of containerized applications.
-
ArgoCD - Argo CD is implemented as a kubernetes controller which continuously monitors running applications and compares the current, live state against the desired target state
Follow the official docs of ArgoCD installation.
- Before that make sure Docker Desktop or Minikube is running on your machine with K8s enabled.
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
Images are being hosted in DockerHub.
FROM python:3.10-alpine
# set work directory
WORKDIR /usr/src/app
# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# install dependencies
RUN pip install --upgrade pip
COPY ./requirements.txt /usr/src/app
RUN pip install -r requirements.txt
# copy project
COPY . /usr/src/app
EXPOSE 8000
RUN python manage.py migrate
RUN python manage.py create_dummy_user
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]
- Make sure Docker is Up and Running
- Build & Upload the image to docker registry
- Clone this repository : https://github.com/mukulmantosh/django-app-k8s
- Update
repoURL
in the manifest fileargo-app.yml
- Update the manifest files pointed in the
dev
path - Make sure to point properly to the correct image registry
- Next, follow the steps given in the
django-app-k8s
repository
If you are interested to know more about GitOps & ArgoCD, then you can follow the below links.