Is there a deploy mode 'global' in Kubernetes?

Joã*_*tos 2 docker kubernetes

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:

  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:
Run Code Online (Sandbox Code Playgroud)

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?

Thank you.

Edu*_*llo 6

DaemonSet是您想要的控制器:

DaemonSet确保所有(或某些)节点都运行Pod的副本。将节点添加到群集时,会将Pods添加到它们。当节点从群集中删除时,这些Pod会被垃圾收集。删除DaemonSet将清除其创建的Pod。

官方文档甚至提到您的需求:

DaemonSet的一些典型用法是:
[...]
-在每个节点上运行日志收集守护程序,例如fluentd或logstash。