Skip to main content

2 posts tagged with "Kubernetes"

View All Tags

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.