<p>I am used to work with Docker swarm and whenever I wanted to deploy one container replica per node available I would use the 'global' deploy mode, as exemplified in this Docker stack yaml:</p>

<pre><code>  logstash:
    image: myregistry:443/mydomain/logstash
    deploy:
      mode: global
      restart_policy:
        condition: on-failure
    ports:
      - "12201:12201/udp"
    environment:
      LS_JAVA_OPTS: "-Xmx256m -Xms256m"
    networks:
      mylan:
</code></pre>

<p>This would deploy one and only one logstash replica in each node available. I am new to Kubernetes and I was attempting to reproduce this behaviour, is there an equivalent mode? If not, what are my alternatives?</p>

<p>Thank you.</p>

João Matos
<p><a href="https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/" rel="noreferrer">DaemonSet</a> is the controller that you wants:</p>

<blockquote>
  <p>A DaemonSet ensures that all (or some) Nodes run a copy of a Pod. As
  nodes are added to the cluster, Pods are added to them. As nodes are
  removed from the cluster, those Pods are garbage collected. Deleting a
  DaemonSet will clean up the Pods it created.</p>
</blockquote>

<p>The official doc even mention your needs:</p>

<blockquote>
  <p>Some typical uses of a DaemonSet are:<br>
  [...]<br>
  - running a logs collection daemon on every node, such as fluentd or logstash.</p>
</blockquote>
