Skip to main content

3 posts tagged with "Kubernetes"

View All Tags

Debugging Django in Production on Kubernetes

· 4 min read
Jennings Zhang
Research Developer @ Boston Children's Hospital

Sometimes, you come across an edge case in production that is just not feasible to reproduce in a development environment. Or, it's more convenient to forego best practices and debug against the real user data.

Debugging in production is a bad practice, furthermore a Kubernetes environment can make things even harder. But for whatever reason, sometimes you have to do what you have to do. Here are some tips on how to debug a Django application in production on Kubernetes.

Shrinking a PersistentVolumeClaim in Kubernetes

· 2 min read
Jennings Zhang
Research Developer @ Boston Children's Hospital

To shrink a PersistentVolumeClaim (PVC) in OpenShift or Kubernetes, we need to:

  1. pause our deployments
  2. copy its data to a smaller, temporary PVC
  3. delete the original PVC
  4. create a new PVC with the original name
  5. copy the data from the temporary PVC to the new PVC
  6. restart our deployments

Django Superuser Creation using Helm

· 3 min read
Jennings Zhang
Research Developer @ Boston Children's Hospital

Creating the superuser of a Django-based application is usually done by running the command manage.py createsuperuser, hence it requires shell access. This makes sense as shell access implies the person should also have admin privileges. However, shell access can be clunky (think of how to run something in a container, kubectl get pods -n chris && kubectl exec -it -n chris <pod_name> python manage.py createsuperuser...). We would prefer a declarative approach.