{%- set resourceName = kolla_kubernetes.cli.args.resource_name %}
{%- import "services/common/common-lib.yml.j2" as lib with context %}
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
   name: cinder-scheduler
   namespace: {{ kolla_kubernetes_namespace }}
spec:
  serviceName: "cinder"
  replicas: {{ cinder_scheduler_replicas }}
  template:
    metadata:
      labels:
        service: cinder
        type: scheduler
    spec:
      nodeSelector:
{%- set selector = kolla_kubernetes_hostlabel_cinder_scheduler |
                       default(kolla_kubernetes_hostlabel_controller)
%}
          {{ selector.key }}: {{ selector.value }}
      containers:
        - name: main
          image: "{{ cinder_scheduler_image_full }}"
          volumeMounts:
{{ lib.common_volume_mounts(indent=12) }}
            - mountPath: /var/lib/kolla-kubernetes/event
              name: kolla-kubernetes-events
            - mountPath: {{ container_config_directory }}
              name: cinder-scheduler-configmap
          env:
            - name: KOLLA_CONFIG_STRATEGY
              value: {{ config_strategy }}
{{ lib.common_containers(indent=8) }}
      volumes:
{{ lib.common_volumes(indent=8) }}
        - name: kolla-kubernetes-events
          emptyDir: {}
        - name: cinder-scheduler-configmap
          configMap:
            name: cinder-scheduler
