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

网站建设的总结200字好的网站分析案例

网站建设的总结200字,好的网站分析案例,沈阳网站备案照相,温岭高端网站设计哪家好kubernetes调度——污点Taint和容忍Toleration 一、通过节点属性调度1、节点名称2、节点标签2.1 查看节点标签2.2 添加标签2.3 修改标签2.4 删除标签2.5 通过节点标签进行调度 二、污点Taint和容忍Toleration1、污点Taint1.1 查看Master节点的污点1.2 添加污点1.3 删除污点 2、…

kubernetes调度——污点Taint和容忍Toleration

  • 一、通过节点属性调度
    • 1、节点名称
    • 2、节点标签
      • 2.1 查看节点标签
      • 2.2 添加标签
      • 2.3 修改标签
      • 2.4 删除标签
      • 2.5 通过节点标签进行调度
  • 二、污点Taint和容忍Toleration
    • 1、污点Taint
      • 1.1 查看Master节点的污点
      • 1.2 添加污点
      • 1.3 删除污点
    • 2、容忍Toleration

一、通过节点属性调度

1、节点名称

[root@k8s-master ~]# kubectl get nodes
NAME                   STATUS   ROLES           AGE    VERSION
k8s-master.linux.com   Ready    control-plane   127d   v1.29.1
k8s-node01.linux.com   Ready    <none>          127d   v1.29.1
k8s-node02.linux.com   Ready    <none>          127d   v1.29.1
apiVersion: apps/v1
kind: Deployment
metadata:name: test1
spec:replicas: 2selector:matchLabels:app: test1template:metadata:labels:app: test1spec:nodeName: k8s-node02.linux.com					// 指定工作节点名称containers:- name: test1image: centos:7imagePullPolicy: IfNotPresentcommand:- sleep- "3600"
[root@k8s-master schedulerTest]# kubectl create -f test1.yaml 
deployment.apps/test1 created
[root@k8s-master schedulerTest]# 
[root@k8s-master schedulerTest]# kubectl get pod -o wide
NAME                         READY   STATUS                   RESTARTS   AGE   IP              NODE                   NOMINATED NODE   READINESS GATES
test1-d69854cd5-jgpvm        1/1     Running                  0          7s    10.88.242.139   k8s-node02.linux.com   <none>           <none>
test1-d69854cd5-tzx6l        1/1     Running                  0          7s    10.88.242.138   k8s-node02.linux.com   <none>           <none>

2、节点标签

2.1 查看节点标签

[root@k8s-master schedulerTest]# kubectl get nodes --show-labels 
NAME                   STATUS   ROLES           AGE    VERSION   LABELS
k8s-master.linux.com   Ready    control-plane   127d   v1.29.1   beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/arch=amd64,kubernetes.io/hostname=k8s-master.linux.com,kubernetes.io/os=linux,node-role.kubernetes.io/control-plane=,node.kubernetes.io/exclude-from-external-load-balancers=
k8s-node01.linux.com   Ready    <none>          127d   v1.29.1   beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/arch=amd64,kubernetes.io/hostname=k8s-node01.linux.com,kubernetes.io/os=linux
k8s-node02.linux.com   Ready    <none>          127d   v1.29.1   beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/arch=amd64,kubernetes.io/hostname=k8s-node02.linux.com,kubernetes.io/os=linux

2.2 添加标签

[root@k8s-master schedulerTest]# kubectl label node k8s-node01.linux.com disk=ssd 
node/k8s-node01.linux.com labeled
[root@k8s-master schedulerTest]# kubectl get nodes --show-labels
NAME                   STATUS   ROLES           AGE    VERSION   LABELS
k8s-master.linux.com   Ready    control-plane   127d   v1.29.1   beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/arch=amd64,kubernetes.io/hostname=k8s-master.linux.com,kubernetes.io/os=linux,node-role.kubernetes.io/control-plane=,node.kubernetes.io/exclude-from-external-load-balancers=
k8s-node01.linux.com   Ready    <none>          127d   v1.29.1   beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,disk=ssd,kubernetes.io/arch=amd64,kubernetes.io/hostname=k8s-node01.linux.com,kubernetes.io/os=linux
k8s-node02.linux.com   Ready    <none>          127d   v1.29.1   beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/arch=amd64,kubernetes.io/hostname=k8s-node02.linux.com,kubernetes.io/os=linux

2.3 修改标签

[root@k8s-master schedulerTest]# kubectl label node k8s-node01.linux.com disk=full --overwrite 
node/k8s-node01.linux.com labeled
[root@k8s-master schedulerTest]# kubectl get node --show-labels
NAME                   STATUS   ROLES           AGE    VERSION   LABELS
k8s-master.linux.com   Ready    control-plane   127d   v1.29.1   beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/arch=amd64,kubernetes.io/hostname=k8s-master.linux.com,kubernetes.io/os=linux,node-role.kubernetes.io/control-plane=,node.kubernetes.io/exclude-from-external-load-balancers=
k8s-node01.linux.com   Ready    <none>          127d   v1.29.1   beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,disk=full,kubernetes.io/arch=amd64,kubernetes.io/hostname=k8s-node01.linux.com,kubernetes.io/os=linux
k8s-node02.linux.com   Ready    <none>          127d   v1.29.1   beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/arch=amd64,kubernetes.io/hostname=k8s-node02.linux.com,kubernetes.io/os=linux
[root@k8s-master schedulerTest]# 

2.4 删除标签

[root@k8s-master schedulerTest]# kubectl label node k8s-node01.linux.com disk-
node/k8s-node01.linux.com unlabeled

2.5 通过节点标签进行调度

apiVersion: apps/v1
kind: Deployment
metadata:name: test2
spec:replicas: 2selector:matchLabels:app: test2template:metadata:labels:app: test2spec:nodeSelector:								// 节点标签 ram: highercontainers:- name: test2image: centos:7imagePullPolicy: IfNotPresentcommand:- sleep- "3600"

二、污点Taint和容忍Toleration

污点、容忍配合使用,避免pod被分配不合适的机器

1、污点Taint

污点,本质上就是个key-value

1.1 查看Master节点的污点

[root@k8s-master schedulerTest]# kubectl describe node k8s-master.linux.com | grep -i taint
Taints:             node-role.kubernetes.io/control-plane:NoSchedule

1.2 添加污点

格式:# kubectl taint node <节点名称> key=value:{NoSchedule|NoExecute|PreferNoSchedule}

污点策略:

  • NoSchedule
    新建的POD不会再向该节点调度
    已经运行在该节点的POD不会受影响

  • NoExecute
    新建的POD不会再向该节点调度
    已经运行在该节点的POD同时也会被驱逐

  • PreferNoSchedule
    尽量不向该节点调度新建的POD

[root@k8s-master schedulerTest]# kubectl taint node k8s-node02.linux.com fan=error:NoExecute 
node/k8s-node02.linux.com tainted[root@k8s-master schedulerTest]# kubectl describe node k8s-node02.linux.com | grep -i taint
Taints:             fan=error:NoExecute

1.3 删除污点

格式:# kubectl taint node <节点名称> key:{NoSchedule|NoExecute|PreferNoSchedule}-

2、容忍Toleration

apiVersion: apps/v1
kind: Deployment
metadata:name: test5
spec:replicas: 2selector:matchLabels:app: test5template:metadata:labels:app: test5spec:containers:- name: test5image: centos:7imagePullPolicy: IfNotPresentcommand:- sleep- "3600"tolerations:									// 容忍fan=error这个污点- key: "fan"operator: "Equal"value: "error"effect: NoExecute
[root@k8s-master ~]# kubectl get pod -o wide
NAME                         READY   STATUS                   RESTARTS   AGE         IP              NODE                   NOMINATED NODE   READINESS GATES
test5-7575ffc867-hs9hf       1/1     Running                  0          2m1s        10.88.242.129   k8s-node02.linux.com   <none>           <none>
test5-7575ffc867-lp4k2       1/1     Running                  0          2m1s        10.88.201.193   k8s-node01.linux.com   <none>           <none>
http://www.yayakq.cn/news/537573/

相关文章:

  • 网站定制哪家快营销推广运营
  • 网站建设考试知识点重生北京上大学开网吧做网站的小说
  • 建设实验室网站的意义做造价在哪个网站查价格
  • eclipse 开发jsp网站开发做专业慢摇的网站
  • 网站建设电上海建设局网站 招聘
  • 河北建设厅官方网站新郑龙湖网站建设
  • 东莞网站建设 包装材料公司网站域名备案对网站名称有要求或界定吗
  • 网站主栏目wordpress登录没链接
  • 青岛网站建设服务中心福建建筑人才网查档案
  • 吉林网站建站系统哪家好吴兴区建设局网站
  • 南京 网站开发萝岗移动网站建设
  • 栖霞建设采购网站怎么制作网站来赚钱
  • 网站源码下载安全吗新网站怎么运营
  • 备案ip 查询网站查询网站查询一个vps主机放两个网站 速度
  • 达州网站建设yufanse广西住房城乡和建设厅网站首页
  • 高新区手机网站建设最新热搜榜
  • 上海网站建设兴策网站如何让百度抓取
  • 低价格的网站建设公司如何对网站的文件和资源进行优化?
  • 怎么提交网站收录湘潭做网站的公司
  • 企业网站建设排名石家庄快速网站搭建
  • 花店网站模板免费下载深圳建工集团股份有限公司待遇
  • 济南行知网站制作品牌网站建设工作室
  • 国外设计网站怎么进入如何设计一个网页主题
  • c语言做的网站有什么优缺点女做受视频网站
  • 济南软件开发培训机构网站关键词优化排名软件
  • 旅行社网站模版成都市装修公司前十强
  • 龙中龙网站开发自建wap网站
  • 民宿预订网站制作学校网站 功能
  • 房地产市场seo词条
  • 做网站推广的方法有哪些国外获奖网站