---
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
  name: contrail-image-installer-agent
  namespace: contrail-system
  labels:
    app: contrail-image-download-agent
spec:
  template:
    metadata:
      labels:
        app: contrail-image-download-agent
    spec:
      hostNetwork: true
      initContainers:
      - name: contrail-download-node-init-image
        image: "{{ contrail_registry }}/contrail-node-init:{{ contrail_container_tag }}"
        imagePullPolicy: "IfNotPresent"
        command: ["/bin/true"]
      - name: contrail-download-node-manager-image
        image: "{{ contrail_registry }}/contrail-nodemgr:{{ contrail_container_tag }}"
        imagePullPolicy: "IfNotPresent"
        command: ["/bin/true"]
      - name: contrail-download-vrouter-kernel-init
        image: "{{ contrail_registry }}/contrail-vrouter-kernel-init:{{ contrail_container_tag }}"
        imagePullPolicy: "IfNotPresent"
        command: ["/bin/true"]
      - name: contrail-download-kubernetes-cni-init
        image: "{{ contrail_registry }}/contrail-kubernetes-cni-init:{{ contrail_container_tag }}"
        imagePullPolicy: "IfNotPresent"
        command: ["/bin/true"]
      - name: contrail-download-vrouter-agent-image
        image: "{{ contrail_registry }}/contrail-vrouter-agent:{{ contrail_container_tag }}"
        imagePullPolicy: "IfNotPresent"
        command: ["/bin/true"]
      containers:
      - name: contrail-download-image-agent
        image: "{{ contrail_registry }}/contrail-status:{{ contrail_container_tag }}"
        imagePullPolicy: "IfNotPresent"
        command: ["tailf","/dev/null"]
        securityContext:
          privileged: true
{% if contrail_registry_username is defined and contrail_registry_password %}
      imagePullSecrets:
      - name: contrail-registry-secret
{% endif %}
