Our elixir-drip-migrations job configuration file will be really similar to the previous Deployment configuration, but instead of running the container default command (that is, sh -c bin/$APP_NAME foreground set on Dockerfile.deploy), we override the command that will be run when the application container starts (that is, sh -c bin/$APP_NAME migrate_up). We also tell Kubernetes to never restart jobs like these, and that it should terminate the job after 300 seconds, no matter what:
$ cat deploy/elixir-drip-migrations-prod.yml apiVersion: batch/v1kind: Jobmetadata: generateName: elixir-drip-migrations namespace: production labels: env: productionspec: activeDeadlineSeconds: 300 template: metadata: labels: env: production ...