apiVersion: batch/v1
kind: Job
metadata:
  name: migrations
  labels:
    app.kubernetes.io/name: ktswebinar
    app.kubernetes.io/component: migrations
spec:
  activeDeadlineSeconds: 120
  template:
    metadata:
      labels:
        app.kubernetes.io/name: ktswebinar
        app.kubernetes.io/component: migrations
    spec:
      restartPolicy: Never
      containers:
        - name: migrations
          image: igorcoding/ktswebinar:1.0.4
          imagePullPolicy: IfNotPresent
          command:
            - python
            - manage.py
            - migrate
          env:
            - name: DATABASE_URL
              value: postgresql://postgres:gYwOKJZaR0do8TUUgPS9@pg:5432/postgres