DaemonSet 清单
DaemonSet 清单
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: node-agent
namespace: kube-system
spec:
selector:
matchLabels:
app: node-agent
template:
metadata:
labels:
app: node-agent
spec:
tolerations:
- key: node-role.kubernetes.io/control-plane
effect: NoSchedule
containers:
- name: agent
image: registry.example.com/agent:2.3.1
volumeMounts:
- name: varlog
mountPath: /var/log
readOnly: true
volumes:
- name: varlog
hostPath:
path: /var/log查看调度覆盖
查看调度覆盖
kubectl get ds -n kube-system
kubectl get pods -l app=node-agent -o wide
kubectl get ds node-agent -o jsonpath='desired={.status.desiredNumberScheduled} ready={.status.numberReady}'默认不为打了 NoSchedule 污点的控制面节点调度;需要覆盖控制面就显式加对应 tolerations。