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

重庆建设公司汕头网站建设方案优化

重庆建设公司,汕头网站建设方案优化,深圳网站建设外贸公司排名,商标logo图案大全图片Manual Scheduling 在 Kubernetes 中,手动调度框架允许您将 Pod 分配到特定节点,而无需依赖默认调度器。这对于测试、调试或处理特定工作负载非常有用。您可以通过在 Pod 的规范中设置 nodeName 字段来实现手动调度。以下是一个示例: apiVe…

Manual Scheduling

在 Kubernetes 中,手动调度框架允许您将 Pod 分配到特定节点,而无需依赖默认调度器。这对于测试、调试或处理特定工作负载非常有用。您可以通过在 Pod 的规范中设置 nodeName 字段来实现手动调度。以下是一个示例:

apiVersion: v1
kind: Pod
metadata:name: manual-scheduled-pod
spec:containers:- name: nginximage: nginxnodeName: your-node-name

your-node-name 替换为您希望 Pod 运行的节点名称。应用此配置后,Kubernetes 会直接将 Pod 放置在指定的节点上。

nodeName

nodeName 是比亲和性或者 nodeSelector 更为直接的形式。nodeName 是 Pod 规约中的一个字段。如果 nodeName 字段不为空,调度器会忽略该 Pod, 而指定节点上的 kubelet 会尝试将 Pod 放到该节点上。 使用 nodeName 规则的优先级会高于使用 nodeSelector 或亲和性与非亲和性的规则。

使用 nodeName 来选择节点的方式有一些局限性:

  • 如果所指代的节点不存在,则 Pod 无法运行,而且在某些情况下可能会被自动删除。
  • 如果所指代的节点无法提供用来运行 Pod 所需的资源,Pod 会失败, 而其失败原因中会给出是否因为内存或 CPU 不足而造成无法运行。
  • 在云环境中的节点名称并不总是可预测的,也不总是稳定的。

警告:nodeName 旨在供自定义调度器或需要绕过任何已配置调度器的高级场景使用。 如果已分配的 Node 负载过重,绕过调度器可能会导致 Pod 失败。 你可以使用节点亲和性或 nodeselector 字段将 Pod 分配给特定 Node,而无需绕过调度器。

下面是一个使用 nodeName 字段的 Pod 规约示例:

apiVersion: v1
kind: Pod
metadata:name: nginx
spec:containers:- name: nginximage: nginxnodeName: kube-01

上面的 Pod 只能运行在节点 kube-01 之上。

Practice Detail

        Welcome to the KodeKloud Hands-On lab                                                                          __ ______  ____  ________ __ __    ____  __  ______ / //_/ __ \/ __ \/ ____/ //_// /   / __ \/ / / / __ \/ ,< / / / / / / / __/ / ,<  / /   / / / / / / / / / // /| / /_/ / /_/ / /___/ /| |/ /___/ /_/ / /_/ / /_/ / 
/_/ |_\____/_____/_____/_/ |_/_____/\____/\____/_____/  All rights reserved                                                                                        controlplane ~ ➜  kubectl create -f nginx.yaml
pod/nginx createdcontrolplane ~ ➜  kubectl get pods
NAME    READY   STATUS    RESTARTS   AGE
nginx   0/1     Pending   0          8scontrolplane ~ ✖ kubectl describe pod nginx
Name:             nginx
Namespace:        default
Priority:         0
Service Account:  default
Node:             <none>
Labels:           <none>
Annotations:      <none>
Status:           Pending
IP:               
IPs:              <none>
Containers:nginx:Image:        nginxPort:         <none>Host Port:    <none>Environment:  <none>Mounts:/var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-bvfbc (ro)
Volumes:kube-api-access-bvfbc:Type:                    Projected (a volume that contains injected data from multiple sources)TokenExpirationSeconds:  3607ConfigMapName:           kube-root-ca.crtConfigMapOptional:       <nil>DownwardAPI:             true
QoS Class:                   BestEffort
Node-Selectors:              <none>
Tolerations:                 node.kubernetes.io/not-ready:NoExecute op=Exists for 300snode.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:                      <none>controlplane ~ ➜  kubectl get pods -n kube-system
NAME                                   READY   STATUS    RESTARTS   AGE
coredns-7484cd47db-mhzfg               1/1     Running   0          10m
coredns-7484cd47db-pq6v7               1/1     Running   0          10m
etcd-controlplane                      1/1     Running   0          10m
kube-apiserver-controlplane            1/1     Running   0          10m
kube-controller-manager-controlplane   1/1     Running   0          10m
kube-proxy-dd6zp                       1/1     Running   0          9m48s
kube-proxy-mtmxb                       1/1     Running   0          10mcontrolplane ~ ➜  echo "no scheduler present"
no scheduler presentcontrolplane ~ ➜  cat nginx.yaml 
---
apiVersion: v1
kind: Pod
metadata:name: nginx
spec:containers:-  image: nginxname: nginxcontrolplane ~ ➜  vi nginx.yamlcontrolplane ~ ➜  cat nginx.yaml 
---
apiVersion: v1
kind: Pod
metadata:name: nginx
spec:nodeName: node01containers:-  image: nginxname: nginxcontrolplane ~ ➜  echo "Manually schedule the pod on node01"
Manually schedule the pod on node01controlplane ~ ➜  cat nginx.yaml
---
apiVersion: v1
kind: Pod
metadata:name: nginx
spec:nodeName: node01containers:-  image: nginxname: nginxcontrolplane ~ ➜  kubectl replace --force -f nginx.yaml
pod "nginx" deleted
pod/nginx replacedcontrolplane ~ ➜  kubectl get pods -o wide
NAME    READY   STATUS    RESTARTS   AGE   IP           NODE     NOMINATED NODE   READINESS GATES
nginx   1/1     Running   0          43s   172.17.1.3   node01   <none>           <none>controlplane ~ ➜  vi nginx.yamlcontrolplane ~ ➜  cat nginx.yaml
---
apiVersion: v1
kind: Pod
metadata:name: nginx
spec:nodeName: controlplanecontainers:-  image: nginxname: nginxcontrolplane ~ ➜  kubectl replace --force -f nginx.yaml
pod "nginx" deleted
pod/nginx replacedcontrolplane ~ ➜  kubectl get pods -o wide
NAME    READY   STATUS    RESTARTS   AGE   IP           NODE           NOMINATED NODE   READINESS GATES
nginx   1/1     Running   0          8s    172.17.0.4   controlplane   <none>           <none>controlplane ~ ➜  echo "Now schedule the same pod on the controlplane node."
Now schedule the same pod on the controlplane node.Powered by Moshow@https://zhengkai.blog.csdn.net/

http://www.dtcms.com/wzjs/242644.html

相关文章:

  • 临海响应式网站设计快速建站网站
  • 菠菜导航网站可以做网络搜索引擎优化
  • 宝鸡seo优化公司武汉seo人才
  • 兰州网站建设程序杭州最好的seo公司
  • 微信怎样将网站的内容做b站怎么推广自己的视频
  • 网站开发难学吗没有限制的国外搜索引擎
  • java 做直播网站有哪些软件下载武汉seo优化服务
  • 动易与php环境架设网站北京seo结算
  • 企业网站的建立意义培训课
  • seo发展前景怎么样啊宁波seo网络推广推荐
  • 阳泉哪里做网站优化提升
  • 顺德官网建设北京专门做seo
  • 怎么建设好一个外贸购物网站百度竞价优化排名
  • 做网站是自己公司做好还是外包好推广技术
  • 邢台市做网站电话app拉新平台有哪些
  • 蚌埠网站关键词优化网站seo基础
  • 北京网站建设还公司品牌营销策划公司排名
  • 腾讯云网站建设视频教程网站模板免费
  • 中国建筑西安专业seo
  • 学校的网站管理系统长尾关键词举例
  • 优秀的学校网站欣赏数据分析培训课程
  • Vs做的网站调试时如何适应网页艺考培训学校
  • 怎样做百度推广网站windows优化大师官方免费下载
  • 中投中原建设有限公司官方网站搜索引擎优化排名关键字广告
  • 托管网站网络营销心得体会
  • 怎么设计网站规划方案安徽网络建站
  • 建设教育网站怎么样推广普通话内容
  • 福州市工程建设质量管理网站外贸高端网站设计公司
  • 手机网站开发相关问题网站收录提交入口网址
  • 有用axure做网站的吗快速开发网站的应用程序