This guide provides step-by-step instructions to deploy a Django project on a K3s (lightweight Kubernetes) cluster.
- A running K3s cluster (Install K3s)
- Docker
- Clone the repository:
git clone https://github.com/deployed/kernel-kubernetes.git - Update in Makefile
- Run
make buildandmake push
- Clone the repository:
git clone https://github.com/deployed/kernel-kubernetes.git - Update in
django-app.yaml,django-migrations.yaml,webserver.yaml - Update in
ingress.yaml - Update in
traefik-le.yaml - Create the namespace:
kubectl create namespace django-apporkubectl apply -f k3s_manifests/namespace.yaml - Create registry secret:
kubectl -n django-app create secret docker-registry k3s-django-app --docker-server=<docker-registry> --docker-username=<username> --docker-password=<token> - Create app secret:
kubectl -n django-app create secret generic django-app-secret --from-literal=POSTGRES_PASSWORD=mysecretpassword --from-literal=DJANGO_SECRET_KEY=yourdjangosecretkey - Apply the manifests:
kubectl apply -f k3s_manifests/ - Check the status:
kubectl get all -n django-app
Application should be accessible at https://
- Delete the namespace:
kubectl delete namespace django-app