{%- 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
metadata:
  name: neutron-manage-db
  namespace: {{ kolla_kubernetes_namespace }}
spec:
  template:
    spec:
      nodeSelector:
{%- set selector = kolla_kubernetes_hostlabel_controller %}
          {{ selector.key }}: {{ selector.value }}
      containers:
        - image: "{{ neutron_server_image_full }}"
          name: main
          env:
            - name: KOLLA_BOOTSTRAP
              value: ""
            - name: KOLLA_CONFIG_STRATEGY
              value: "{{ config_strategy }}"
          volumeMounts:
{{ lib.common_volume_mounts(indent=12) }}
            - mountPath: {{ container_config_directory }}
              name: neutron-server-config
              readOnly: true
      volumes:
{{ lib.common_volumes(indent=8) }}
        - name: neutron-server-config
          configMap:
            name: neutron-server
            items:
            - key: neutron.conf
              path: neutron.conf
            - key: config.json
              path: config.json
            - key: ml2-conf.ini
              path: ml2_conf.ini
            - key: neutron-lbaas.conf
              path: neutron_lbaas.conf
            - key: neutron-vpnaas.conf
              path: neutron_vpnaas.conf
      restartPolicy: OnFailure
