共计 478 个字符,预计需要花费 2 分钟才能阅读完成。
业务场景 
 因为某些服务不稳定,导致会影响到基础的服务需要把服务强制绑定到某个节点。同时不允许其他服务调度到这个节点上。
配置如下。
可以通过界面或者命令行配置标签 
 配置污点命令如下 
kubectl taint node nodexx1 node-type=production:NoSchedule
 通过命令可以看到标签和污点已经设置好了
kubectl describe nodes nodexx1.png)
配置好后 yaml 文件设置如下即可
  template:
    metadata:
      labels:
        app: ${PROJECT_NAME}-${VERSION}
    spec:
      nodeSelector:
        project: lk
      imagePullSecrets:
        - name: harborxxx
      tolerations:
        - effect: NoSchedule
          key: node-type
          operator: Equal
          value: production
官网配置参考如下
https://kubernetes.io/zh/docs/concepts/scheduling-eviction/taint-and-toleration/
微信扫描下方的二维码阅读本文

正文完
                                                
                                    发表至: 运维                                
                                
                                     2021-04-02
                                
                            



