deployment部署得副本pod会分布在各个node上,每个node上可以运行很多个pod。

daemonset的不同之处就在于,daemonset可以让每个node上只运行一个pod

 

daemonset的应用场景有:

1.在集群的每个节点上运行存储daemonset,比如glusterd或ceph

2.在那个节点上运行日志收集daemon,比如 flunentd 或 logstash

3.在每个节点上运行监控Daemon,比如 Prometheus Node Exporter 或 collectd

 

我们之前部署kubernetes时就发现master以及每个node上面运行就是K8s的系统组件,执行如下命令:

 kubectl get daemonset --namespace=kube-system

 

centos7下kubernetes(10。kubernetes-daemonset)

daemonset kube-flannel-ds和kube-proxy分别负责在每个节点上运行flannel和kube-proxy组件

 

 

我们之前部署flannel的时候的时通过yml中部署的,我们现在查看一下flannel的yml文件

centos7下kubernetes(10。kubernetes-daemonset)

kind:属于daemonset

hostnetwork:指定pod使用的是node的网络,相当于docker run --network=host。考虑到flannel要为集群提供网络连接,这个要求是合理的

containers:定义了运行flannel服务的容器

 

 

 

kube-proxy

由于kube-proxyde 是我们在部署的时候直接使用命令起来的,可以使用

kubectl edit daemonset kube-proxy --namespace=kube-system

centos7下kubernetes(10。kubernetes-daemonset)

 

centos7下kubernetes(10。kubernetes-daemonset)

kind:daemonset类型

containers:定义了proxy的容器

status:是当前daemonset运行时的状态,这个部分是kubectl edit特有的

 

k8s集群中每个运行的资源都可以通过kubectl edit查看其配置和运行状态,比如kubectl edit deployment nginx-deployment

 

相关文章:

  • 2021-08-02
  • 2021-10-25
  • 2022-01-27
  • 2021-09-18
  • 2021-07-10
  • 2022-12-23
  • 2022-01-28
  • 2021-09-25
猜你喜欢
  • 2021-10-23
  • 2022-12-23
  • 2021-12-22
  • 2021-08-25
  • 2022-01-12
  • 2021-12-11
相关资源
相似解决方案