当前位置: 首页 > news >正文

无锡市新吴区住房和建设交通局网站seo3立体构型

无锡市新吴区住房和建设交通局网站,seo3立体构型,建设工程公司网站,做数据结构基础的网站目录 一、Taint(污点) 1.污点的组成 2.污点的设置、查看和去除 3.污点实验: 二、Toleration(容忍) 1.容忍设置的方案 2.容忍实验: Taint 和 toleration 相互配合,可以用来避免 pod 被分配…

目录

一、Taint(污点)

1.污点的组成

2.污点的设置、查看和去除

3.污点实验:

二、Toleration(容忍)

1.容忍设置的方案

2.容忍实验:


       Taint 和 toleration 相互配合,可以用来避免 pod 被分配到不合适的节点上。每个节点上都可以应用一个或多个 taint ,这表示对于那些不能容忍这些 taint 的 pod,是不会被该节点接受的。如果将 toleration 应用于 pod 上,则表示这些 pod 可以(但不要求)被调度到具有匹配 taint 的节点上。

一、Taint(污点)

       使用 `kubectl taint` 命令可以给某个 Node 节点设置污点,Node 被设置上污点之后就和 Pod 之间存在了一种相斥的关系,可以让 Node 拒绝 Pod 的调度执行,甚至将 Node 已经存在的 Pod 驱逐出去

1.污点的组成

         key=value:effect

         每个污点有一个 key 和 value 作为污点的标签,其中 value 可以为空,effect 描述污点的作用。当前 taint effect 支持如下三个选项:

NoSchedule:表示 k8s 将不会将 Pod 调度到具有该污点的 Node 上PreferNoSchedule:表示 k8s 将尽量避免将 Pod 调度到具有该污点的 Node 上NoExecute:表示 k8s 将不会将 Pod 调度到具有该污点的 Node 上,同时会将 Node 上已经存在的 Pod 驱逐出去。

2.污点的设置、查看和去除

kubectl taint nodes node1 key1=value1:NoSchedule# 设置污点kubectl describe node  node-name# 节点说明中,查找 Taints 字段kubectl taint nodes node1 key1:NoSchedule-# 去除污点

3.污点实验:

kubectl describe node k8s-master01#主节点自带污点,所以master节点不能被调度

kubectl taint node k8s-master01 node-role.kubernetes.io/master=:NoSchedule-#取消master节点的污点kubectl describe node k8s-master01#查看污点已被删除kubectl create deployment taint_deploy --image=nginx:latest#创建名为taint_deploy的deployment,使用nginx:latest作为pod内容器创建的镜像。kubectl scale deployment taint_deploy --replicas=20#设置刚刚创建的deployment的pod副本数为20kubectl get pod -o wide#观察刚刚创建的pod,因为取消了master节点的污点,所以pod可以被调度到master节点运行了#master节点没有污点的情况下,运行daemonset,master节点也会运行一个daemonset。

二、Toleration(容忍)

       设置了污点的 Node 将根据 taint 的 effect:NoSchedule、PreferNoSchedule、NoExecute 和 Pod 之间产生互斥的关系,Pod 将在一定程度上不会被调度到 Node 上。 但我们可以在 Pod 上设置容忍 ( Toleration ) ,意思是设置了容忍的 Pod 将可以容忍污点的存在,可以被调度到存在污点的 Node 上。

pod.spec.tolerations

1.容忍设置的方案

tolerations:	#容忍第一种方案:
- key: "key1"	#指定污点的key1operator: "Equal"	#运算符等于value: "value1"	#value是污点value1effect: "NoSchedule"	#策略是NoSchedule
#这种写法的含义是key,value,effect必须全部匹配,有一个不一样都匹配不到。第二种方案:
- key: "key1"operator: "Equal"value: "value1"effect: "NoExecute"tolerationSeconds: 3600	#容忍3600秒第三种方案:
- key: "key2"		#只要匹配到key和dffect,value是什么无所谓。operator: "Exists"effect: "NoSchedule"

例:

Ⅰ、当不指定 key 值时,表示容忍所有的污点 key:** 
tolerations:
- operator: "Exists"		#只写一个存在,只要有污点,就能容忍Ⅱ、当不指定 effect 值时,表示容忍所有的污点作用**
tolerations:
- key: "key"operator: "Exists"		#只要key匹配到了,其他的无所谓Ⅲ、有多个 Master 存在时,防止资源浪费,可以如下设置
kubectl taint nodes Node-Name node-role.kubernetes.io/master=:PreferNoSchedule

2.容忍实验:

kubectl taint node k8s-master01 node-role.kibernetes.io/master=:NoSchedule	#将主节点的污点恢复回来kubectl get daemonset -n kube-system#查看有哪些daemonset资源kubectl get daemonset -n kube-system calico-node -o yaml#查看calico的容忍#策略NoSchedule,运算符Exists(存在),key和value无所谓#value和策略无所谓#还能容忍NoExecute策略的,value和key无所谓

kubectl describe node k8s-master01#查询master节点的keyvim tolerations_daemonset.yamlapiVersion: apps/v1
kind: DaemonSet
metadata:name: tolerations-daemonsetlabels:app: daemonset
spec:selector:matchLabels:name: tolerations-daemonset-podtemplate:metadata:labels:name: tolerations-daemonset-podspec:tolerations:- key: "node-role.kubernetes.io/master"    #master节点的污点的key。operator: "Exists"    #匹配规则为exists,存在key就容忍。containers:- name: tolerations-daemonset-podimage: nginx:latestimagePullPolicy: IfNotPresentkubectl apply -f tolerations_daemonset.yamlkubectl get daemonset#查看创建的daemonsetkubectl get pod -o wide#查看daemonset的pod是否调度在master上。
http://www.yayakq.cn/news/676420/

相关文章:

  • 东莞五金网站建设无锡中小企业网站制作
  • 宁波招聘网站开发纺织品做外贸一般在哪个网站上
  • 国外设计搜索网站网站建设网站的好处
  • 企业网站有哪些类型专业版简历
  • 山西省网站建设哪里好零基础学建站
  • 商品网站wordpress 图片上传
  • 网站制作公司有哪些个人网站源码进一品资源
  • 如何快速提升网站权重6网站建设做网站
  • 工信和信息化网站备案系统免费的软件下载安装
  • wordpress主题的网站模板接技术标做网站
  • 网店网站怎么做专门做各种产品测评的网站
  • 企业网站趋势温州 建网站
  • 个人网站备案备注范文西地那非能延时吗
  • 博物馆网站建设方案书wordpress4.9.5漏洞
  • 网站开发者模式怎么打开域名备案码
  • 把网站放到服务器网站 not found
  • 怎样进入外贸公司网站网站建设开发员
  • 万网如何建设网站网站通栏代码
  • php网站开发环境论文wordpress对网站排名
  • 在线游戏网站域名注册后怎么搭建网页
  • 揭阳seo快速排名网店推广实训标题优化答案
  • 网站 数据备份wordpress文章和页面的区别
  • 电子商务网站建设与管理 学习感想天津做网站软件
  • 建设网站的题目网站建设的用户体验
  • 长沙做官方网站丽水 网站建设
  • 设计师必看的10个网站阿里域名
  • dw如何建立网站最新章节 第一百四十七章 做视频网站
  • 河南外贸网站制作html 单页网站
  • 网站相关推荐怎么做专门做纪录片的网站
  • 什么自己做网站报名网站制作