apiVersion: v1
kind: ReplicationController
spec:
  replicas: 1
  selector:
      service: mariadb
  template:
    metadata:
      labels:
        service: mariadb
    spec:
      hostNetwork: True
      containers:
        - image: "{{ mariadb_image_full }}"
          name: mariadb
          volumeMounts:
            - mountPath: {{ container_config_directory }}
              name: mariadb-config
            - mountPath: /var/lib/mysql
              name: mariadb-persistent-storage
            - mountPath: /var/log/kolla/
              name: kolla-logs
          env:
            - name: KOLLA_CONFIG_STRATEGY
              value: {{ config_strategy }}
            #TODO: Replace with templated values
            - name: ETCD_HOST
              value: {{ etcd_ip_address }}
            - name: ETCD_PORT
              value: "{{ etcd_port }}"
      volumes:
        - name: mariadb-config
          configMap:
            name: mariadb-configmap
        - name: mariadb-persistent-storage
          hostPath:
            path: /var/lib/mysql
        - name: kolla-logs
          emptyDir: {}
metadata:
   name: mariadb