{%- set resourceName = kolla_kubernetes.cli.args.resource_name %}
{%- import "services/common/common-lib.yml.j2" as lib with context %}
apiVersion: v1
kind: Pod
spec:
  hostNetwork: True
  nodeSelector:
{%- set selector = kolla_kubernetes_hostlabel_storage_swift |
                       default(kolla_kubernetes_hostlabel_storage |
                         default(kolla_kubernetes_hostlabel_controller)
                       )
%}
      {{ selector.key }}: {{ selector.value }}
  containers:
    - image: "{{ swift_rsyncd_image_full }}"
      name: swift-rsyncd
      volumeMounts:
{{ lib.common_volume_mounts(indent=8) }}
        - mountPath: {{ container_config_directory }}/
          name: swift-rsyncd-config
        - mountPath: {{ swift_devices_mount_point }}
          name: swift-devices
    - image: "{{ swift_account_image_full }}"
      name: main
      volumeMounts:
{{ lib.common_volume_mounts(indent=8) }}
        - mountPath: /var/lib/kolla/swift/
          name: swift-config
        - mountPath: {{ container_config_directory }}/
          name: swift-account-server-config
        - mountPath: {{ swift_devices_mount_point }}
          name: swift-devices
    - image: "{{ swift_account_image_full }}"
      name: swift-account-auditor
      volumeMounts:
{{ lib.common_volume_mounts(indent=8) }}
        - mountPath: /var/lib/kolla/swift/
          name: swift-config
        - mountPath: {{ container_config_directory }}/
          name: swift-account-auditor-config
        - mountPath: {{ swift_devices_mount_point }}
          name: swift-devices
    - image: "{{ swift_account_image_full }}"
      name: swift-account-replicator
      volumeMounts:
{{ lib.common_volume_mounts(indent=8) }}
        - mountPath: /var/lib/kolla/swift/
          name: swift-config
        - mountPath: {{ container_config_directory }}/
          name: swift-account-replicator-config
        - mountPath: {{ swift_devices_mount_point }}
          name: swift-devices
    - image: "{{ swift_account_image_full }}"
      name: swift-account-reaper
      volumeMounts:
{{ lib.common_volume_mounts(indent=8) }}
        - mountPath: /var/lib/kolla/swift/
          name: swift-config
        - mountPath: {{ container_config_directory }}/
          name: swift-account-reaper-config
        - mountPath: {{ swift_devices_mount_point }}
          name: swift-devices
  volumes:
{{ lib.common_volumes(indent=4) }}
    - name: swift-rsyncd-config
      configMap:
        name: swift-rsyncd
    - name: swift-account-server-config
      configMap:
        name: swift-account-server
    - name: swift-account-auditor-config
      configMap:
        name: swift-account-auditor
    - name: swift-account-replicator-config
      configMap:
        name: swift-account-replicator
    - name: swift-account-reaper-config
      configMap:
        name: swift-account-reaper
    - name: swift-config
      hostPath:
        path: {{ node_config_directory }}/swift/
    - name: swift-devices
      hostPath:
        path: {{ swift_devices_mount_point }}
metadata:
   name: swift-account
   namespace: {{ kolla_kubernetes_namespace }}
