apiVersion: batch/v1
kind: Job
metadata:
  name: $APPLICATION_NAME-initializer
  labels:
    app.kubernetes.io/name: $APPLICATION_NAME
  annotations:
    sidecar.istio.io/inject: "false"
spec:
  backoffLimit: 0
  template:
    metadata:
      name: $APPLICATION_NAME-initializer
      labels:
        app.kubernetes.io/name: $APPLICATION_NAME
      annotations:
        sidecar.istio.io/inject: "false"
    spec:
      serviceAccountName: $SERVICE_ACCOUNT
      restartPolicy: Never
      containers:
      - name: initializer
        image: $KYMA_INITIALIZER_IMAGE
        imagePullPolicy: Always
        env:
        - name: APPLICATION_NAME
          value: $APPLICATION_NAME
        - name: NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
