{%- set resourceName = kolla_kubernetes.cli.args.service_name %}
apiVersion: v1
kind: ReplicationController
spec:
  replicas: {{ rabbitmq_replicas }}
  selector:
      service: rabbitmq
  template:
    metadata:
      labels:
        service: rabbitmq
    spec:
      containers:
        - image: "{{ rabbitmq_image_full }}"
          name: rabbitmq
          volumeMounts:
            - mountPath: {{ container_config_directory }}
              name: rabbitmq-config
            - mountPath: /var/lib/rabbitmq
              name: rabbitmq-persistent-storage
            - mountPath: /var/log/kolla
              name: kolla-logs
          env:
            - name: KOLLA_CONFIG_STRATEGY
              value: {{ config_strategy }}
          ports:
            - containerPort: {{ rabbitmq_port }}
              name: rabbitmq
            - containerPort: {{ rabbitmq_management_port }}
              name: management
      volumes:
        - name: rabbitmq-config
          configMap:
            name: rabbitmq-configmap
        - name: rabbitmq-persistent-storage
          persistentVolumeClaim:
            claimName: {{ resourceName }}
        - name: kolla-logs
          emptyDir: {}
metadata:
   name: rabbitmq