Created
November 25, 2021 18:32
-
-
Save darcwader/749a8975c0c2b86459210ab51abc350c to your computer and use it in GitHub Desktop.
django migration job
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: batch/v1 | |
kind: Job | |
metadata: | |
name: mlserver-migration | |
spec: | |
parallelism: 1 | |
template: | |
spec: | |
containers: | |
- name: cloudsql-proxy | |
image: gcr.io/cloudsql-docker/gce-proxy:1.16 | |
command: ["/cloud_sql_proxy", "-instances=project-name-here:name=tcp:5499", "-credential_file=/path/to/creds.json"] | |
- name: mlserver-django | |
image: gcr.io/path/to/your/custom/image:12345 | |
command: ["/bin/sh", "-c"] | |
args: | |
- | | |
python manage.py migrate; | |
sql_proxy_pid=$(pgrep cloud_sql_proxy) && kill -INT $sql_proxy_pid; | |
securityContext: | |
capabilities: | |
add: | |
- SYS_PTRACE | |
imagePullPolicy: Always | |
restartPolicy: Never | |
shareProcessNamespace: true | |
backoffLimit: 4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment