{%- set resourceName = kolla_kubernetes.cli.args.resource_name %}
{%- set netHostTrue = "yes" %}
{%- 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_container_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-container-server-config
        - mountPath: {{ swift_devices_mount_point }}
          name: swift-devices
    - image: "{{ swift_container_image_full }}"
      name: swift-container-auditor
      volumeMounts:
{{ lib.common_volume_mounts(indent=8) }}
        - mountPath: /var/lib/kolla/swift/
          name: swift-config
        - mountPath: {{ container_config_directory }}/
          name: swift-container-auditor-config
        - mountPath: {{ swift_devices_mount_point }}
          name: swift-devices
    - image: "{{ swift_container_image_full }}"
      name: swift-container-replicator
      volumeMounts:
{{ lib.common_volume_mounts(indent=8) }}
        - mountPath: /var/lib/kolla/swift/
          name: swift-config
        - mountPath: {{ container_config_directory }}/
          name: swift-container-replicator-config
        - mountPath: {{ swift_devices_mount_point }}
          name: swift-devices
    - image: "{{ swift_container_image_full }}"
      name: swift-container-updater
      volumeMounts:
{{ lib.common_volume_mounts(indent=8) }}
        - mountPath: /var/lib/kolla/swift/
          name: swift-config
        - mountPath: {{ container_config_directory }}/
          name: swift-container-updater-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-container-server-config
      configMap:
        name: swift-container-server
    - name: swift-container-auditor-config
      configMap:
        name: swift-container-auditor
    - name: swift-container-replicator-config
      configMap:
        name: swift-container-replicator
    - name: swift-container-updater-config
      configMap:
        name: swift-container-updater
    - name: swift-config
      hostPath:
        path: {{ node_config_directory }}/swift/
    - name: swift-devices
      hostPath:
        path: {{ swift_devices_mount_point }}
metadata:
   name: swift-container
   namespace: {{ kolla_kubernetes_namespace }}
