apiVersion: batch/v1
kind: Job
metadata:
  name: kong-migration
  namespace: kong
spec:
  template:
    metadata:
      name: kong-migration
    spec:
      containers:
      - name: kong-migration
        image: kong:1.2
        env:
          - name: KONG_NGINX_DAEMON
            value: 'off'
          - name: KONG_DATABASE
            value: cassandra
          - name: KONG_CASSANDRA_CONTACT_POINTS
            value: cassandra.default.svc.cluster.local
          - name: KONG_CASSANDRA_KEYSPACE
            value: kong
        command: [ "/bin/sh", "-c", "kong migrations bootstrap" ]
      restartPolicy: Never
