👷(helm) command createsuperuser

We need a superuser in the Django
application, to have access to the admin part.
This commit create a superuser on the pods.
This commit is contained in:
Anthony LC
2024-06-19 10:39:18 +02:00
committed by Anthony LC
parent 9a7a8e4a34
commit 3c481e75bb
6 changed files with 151 additions and 13 deletions

View File

@@ -56,16 +56,3 @@ cmd_button('Migrate db',
icon_name='developer_board',
text='Run database migration',
)
pod_add_admin = '''
set -eu
# get k8s pod name from tilt resource name
POD_NAME="$(tilt get kubernetesdiscovery desk-backend -ojsonpath='{.status.pods[0].name}')"
kubectl -n desk exec "$POD_NAME" -- python manage.py createsuperuser --password admin --admin_email admin@example.com
'''
cmd_button('Add admin',
argv=['sh', '-c', pod_add_admin],
resource='desk-backend',
icon_name='developer_board',
text='Create superadmin',
)