{%- set podTypeBootstrap = "yes" %}
{%- set resourceName = kolla_kubernetes.cli.args.resource_name %}
{%- import "services/common/common-lib.yml.j2" as lib with context %}
apiVersion: batch/v1
kind: Job
spec:
  parallelism: 1
  completions: 1
  template:
    spec:
      nodeSelector:
{%- set selector = kolla_kubernetes_hostlabel_controller %}
          {{ selector.key }}: {{ selector.value }}
      containers:
        - image: "{{ nova_api_image_full }}"
          name: main
          volumeMounts:
{{ lib.common_volume_mounts(indent=12) }}
            - mountPath: {{ container_config_directory }}
              name: nova-api-config
            - mountPath: /lib/modules
              name: lib-modules
          env:
            - name: KOLLA_BOOTSTRAP
              value: ""
            - name: KOLLA_CONFIG_STRATEGY
              value: {{ config_strategy }}
      volumes:
{{ lib.common_volumes(indent=8) }}
        - name: nova-api-config
          configMap:
            name: nova-api
        - name: lib-modules
          hostPath:
            path: /lib/modules
      restartPolicy: OnFailure
metadata:
  name: nova-create-api-db
  namespace: {{ kolla_kubernetes_namespace }}
