Django run custom management command on docker + Kubernetes env

1/18/2018

I have deployed my Django application on AWS using Kubernetes. I am using docker containers to deploy my application. I have created the custom management command lets say

python manage.py customcommand

I want execute it on kubernetes level.

To get pods i am using

kubctl get pods

I am trying to find solution but not succeeded Thank you.

-- Gaurav
amazon-web-services
django
docker
kubernetes
python

1 Answer

1/18/2018

You can access a shell in your running pod by using a command similar to the following:

kubectl exec -ti <podname> sh

From the shell prompt you get, you can run your administrative command.

-- whites11
Source: StackOverflow