新增pod其它控制
This commit is contained in:
37
k8s知识笔记/二、k8s pod 控制器/4、daemonSet控制器.conf
Normal file
37
k8s知识笔记/二、k8s pod 控制器/4、daemonSet控制器.conf
Normal file
@@ -0,0 +1,37 @@
|
||||
一、DeamonSet 简介
|
||||
DaemonSet 是 Kubernetes 中的一种控制器, 用于确保在集群中的每个节点上运行有且只有一个 Pod 的副本。
|
||||
它通常用于部署需要在每个节点上运行的后台服务, 例如日志收集、监控代理等。
|
||||
当有Node加入集群时,也会为他们新增一个Pod。当有Node从集群移除时,这些Pod也会被回收。
|
||||
删除DaemonSet将会删除它创建的所有Pod
|
||||
|
||||
使用场景:
|
||||
1. 集群日志收集: 在每个节点上运行日志收集代理, 如Fluentd, Logstash等
|
||||
2. 监控代理: 在每个节点上运行监控代理, 如Prometheus Node Exporter, Datadog Agent等
|
||||
3. 网络插件: 在每个节点上运行网络插件, 如Calico, Weave等
|
||||
4. 存储插件: 在每个节点上运行存储插件, 如Ceph, GlusterFS等
|
||||
5. 安全代理: 在每个节点上运行安全代理, 如Falco, Sysdig等
|
||||
|
||||
#-----------------------------------------------------------------------------------------------
|
||||
|
||||
二、DaemonSet 控制器清单示例
|
||||
|
||||
apiVersion: apps/v1
|
||||
kind: DaemonSet
|
||||
metadata:
|
||||
name: my-daemonset
|
||||
labels:
|
||||
app: my-daemonset
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: my-daemonset
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: my-daemonset
|
||||
spec:
|
||||
containers:
|
||||
- name: my-container
|
||||
image: nginx:1.7.9
|
||||
ports:
|
||||
- containerPort: 80
|
||||
Reference in New Issue
Block a user