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

右安门网站建设东莞网站建设方案维护

右安门网站建设,东莞网站建设方案维护,网站开发定制多少钱,营销型网站建设公司提供网站建设在《研发工程师玩转Kubernetes——启动、存活和就绪探针》中#xff0c;我们讲了就绪探针和服务之间的特殊关系。就绪探针检测失败并不代表整个程序处于“非存活”状态#xff0c;可能只是短暂临时的不可以提供服务#xff0c;比如CPU阶段性占满#xff0c;导致就绪探针检测…在《研发工程师玩转Kubernetes——启动、存活和就绪探针》中我们讲了就绪探针和服务之间的特殊关系。就绪探针检测失败并不代表整个程序处于“非存活”状态可能只是短暂临时的不可以提供服务比如CPU阶段性占满导致就绪探针检测超时而导致失败。这个时候就绪探针并不会向存活探针那样尝试重启容器而只是简单的把它从何它关联的Service中摘除。 带Readiness Probe的Nginx apiVersion: apps/v1 kind: Deployment metadata:name: readiness-nginx-deployment spec:selector:matchLabels:app: readiness-nginxreplicas: 2template:metadata:labels:app: readiness-nginxspec:containers:- name: readiness-nginx-containerimage: nginxports:- containerPort: 80command: [/bin/sh, -c, sleep 3; touch /tempdir/readiness-nginx; while true; do sleep 5; done]volumeMounts:- name: probe-volumemountPath: /tempdirreadinessProbe:exec:command:- cat- /tempdir/readiness-nginxinitialDelaySeconds: 2failureThreshold: 6periodSeconds: 1successThreshold: 1volumes:- name: probe-volumeemptyDir: medium: MemorysizeLimit: 1GiNginx关联的Service kind: Service apiVersion: v1 metadata:name: readiness-nginx-service spec:selector:app: readiness-nginxports:- protocol: TCPport: 80targetPort: 80实验 创建上述组件可以看到启动了下面的Pod kubectl get pod -o wideNAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES readiness-nginx-deployment-57b7fd5644-7x7wc 1/1 Running 0 25s 10.1.43.223 ubuntuc none none readiness-nginx-deployment-57b7fd5644-lhszp 1/1 Running 0 25s 10.1.209.155 ubuntub none noneService也绑定了这些IP。 kubectl describe endpoints readiness-nginx-service Name: readiness-nginx-service Namespace: default Labels: none Annotations: endpoints.kubernetes.io/last-change-trigger-time: 2023-08-14T14:35:33Z Subsets:Addresses: 10.1.209.155,10.1.43.223NotReadyAddresses: nonePorts:Name Port Protocol---- ---- --------unset 80 TCPEvents: none现在我们挑选一个容器readiness-nginx-deployment-57b7fd5644-7x7wc10.1.43.223观察该容器的Event状态 kubectl describe pod readiness-nginx-deployment-57b7fd5644-7x7wcName: readiness-nginx-deployment-57b7fd5644-7x7wc Namespace: default Priority: 0 Service Account: default Node: ubuntuc/172.22.247.176 Start Time: Mon, 14 Aug 2023 14:35:27 0000 Labels: appreadiness-nginxpod-template-hash57b7fd5644 Annotations: cni.projectcalico.org/containerID: c475d3e82ff0d5adbd35252ab990608ad75955f8d0862bb8b0c54ee60a0878ebcni.projectcalico.org/podIP: 10.1.43.223/32cni.projectcalico.org/podIPs: 10.1.43.223/32 Status: Running IP: 10.1.43.223 IPs:IP: 10.1.43.223 Controlled By: ReplicaSet/readiness-nginx-deployment-57b7fd5644 Containers:readiness-nginx-container:Container ID: containerd://5d82d8467bc6e0c8151e40ee3258d54bffec8659bcdad4a441848ea8f77a3223Image: nginxImage ID: docker.io/library/nginxsha256:67f9a4f10d147a6e04629340e6493c9703300ca23a2f7f3aa56fe615d75d31caPort: 80/TCPHost Port: 0/TCPCommand:/bin/sh-csleep 3; touch /tempdir/readiness-nginx; while true; do sleep 5; doneState: RunningStarted: Mon, 14 Aug 2023 14:35:30 0000Ready: TrueRestart Count: 0Readiness: exec [cat /tempdir/readiness-nginx] delay2s timeout1s period1s #success1 #failure6Environment: noneMounts:/tempdir from probe-volume (rw)/var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-c4tcl (ro) Conditions:Type StatusInitialized True Ready True ContainersReady True PodScheduled True Volumes:probe-volume:Type: EmptyDir (a temporary directory that shares a pods lifetime)Medium: MemorySizeLimit: 1Gikube-api-access-c4tcl:Type: Projected (a volume that contains injected data from multiple sources)TokenExpirationSeconds: 3607ConfigMapName: kube-root-ca.crtConfigMapOptional: nilDownwardAPI: true QoS Class: BestEffort Node-Selectors: none Tolerations: node.kubernetes.io/not-ready:NoExecute opExists for 300snode.kubernetes.io/unreachable:NoExecute opExists for 300s Events:Type Reason Age From Message---- ------ ---- ---- -------Normal Scheduled 3m53s default-scheduler Successfully assigned default/readiness-nginx-deployment-57b7fd5644-7x7wc to ubuntucNormal Pulling 3m53s kubelet Pulling image nginxNormal Pulled 3m50s kubelet Successfully pulled image nginx in 2.489885583s (2.489893984s including waiting)Normal Created 3m50s kubelet Created container readiness-nginx-containerNormal Started 3m50s kubelet Started container readiness-nginx-containerWarning Unhealthy 3m48s (x2 over 3m48s) kubelet Readiness probe failed: cat: /tempdir/readiness-nginx: No such file or directory可以看到就绪探针在第3次检测时就存在了这个时候Pod的Ready和ContainersReady都是True的状态。 就绪-非就绪 现在我们删除就绪标志文件 kubectl exec pods/readiness-nginx-deployment-57b7fd5644-7x7wc --container readiness-nginx-container -- rm /tempdir/readiness-nginx再观察其状态可以发现 Name: readiness-nginx-deployment-57b7fd5644-7x7wc Namespace: default Priority: 0 Service Account: default Node: ubuntuc/172.22.247.176 Start Time: Mon, 14 Aug 2023 14:35:27 0000 Labels: appreadiness-nginxpod-template-hash57b7fd5644 Annotations: cni.projectcalico.org/containerID: c475d3e82ff0d5adbd35252ab990608ad75955f8d0862bb8b0c54ee60a0878ebcni.projectcalico.org/podIP: 10.1.43.223/32cni.projectcalico.org/podIPs: 10.1.43.223/32 Status: Running IP: 10.1.43.223 IPs:IP: 10.1.43.223 Controlled By: ReplicaSet/readiness-nginx-deployment-57b7fd5644 Containers:readiness-nginx-container:Container ID: containerd://5d82d8467bc6e0c8151e40ee3258d54bffec8659bcdad4a441848ea8f77a3223Image: nginxImage ID: docker.io/library/nginxsha256:67f9a4f10d147a6e04629340e6493c9703300ca23a2f7f3aa56fe615d75d31caPort: 80/TCPHost Port: 0/TCPCommand:/bin/sh-csleep 3; touch /tempdir/readiness-nginx; while true; do sleep 5; doneState: RunningStarted: Mon, 14 Aug 2023 14:35:30 0000Ready: FalseRestart Count: 0Readiness: exec [cat /tempdir/readiness-nginx] delay2s timeout1s period1s #success1 #failure6Environment: noneMounts:/tempdir from probe-volume (rw)/var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-c4tcl (ro) Conditions:Type StatusInitialized True Ready False ContainersReady False PodScheduled True Volumes:probe-volume:Type: EmptyDir (a temporary directory that shares a pods lifetime)Medium: MemorySizeLimit: 1Gikube-api-access-c4tcl:Type: Projected (a volume that contains injected data from multiple sources)TokenExpirationSeconds: 3607ConfigMapName: kube-root-ca.crtConfigMapOptional: nilDownwardAPI: true QoS Class: BestEffort Node-Selectors: none Tolerations: node.kubernetes.io/not-ready:NoExecute opExists for 300snode.kubernetes.io/unreachable:NoExecute opExists for 300s Events:Type Reason Age From Message---- ------ ---- ---- -------Warning Unhealthy 7s (x22 over 6m6s) kubelet Readiness probe failed: cat: /tempdir/readiness-nginx: No such file or directory可以看到Ready和ContainersReady都变成了False状态。 我们再观察Service kubectl describe endpoints readiness-nginx-service Name: readiness-nginx-service Namespace: default Labels: none Annotations: endpoints.kubernetes.io/last-change-trigger-time: 2023-08-14T14:41:18Z Subsets:Addresses: 10.1.209.155NotReadyAddresses: 10.1.43.223Ports:Name Port Protocol---- ---- --------unset 80 TCPEvents: none可以看到被删除了就绪探针检测文件的Pod被从Service中摘掉了。 非就绪-就绪 我们再将检测文件还原 kubectl exec pods/readiness-nginx-deployment-57b7fd5644-7x7wc --container readiness-nginx-container -- touch /tempdir/readiness-nginx观察对应Pod的状态其Ready和ContainersReady又变成了True状态。 Name: readiness-nginx-deployment-57b7fd5644-7x7wc Namespace: default Priority: 0 Service Account: default Node: ubuntuc/172.22.247.176 Start Time: Mon, 14 Aug 2023 14:35:27 0000 Labels: appreadiness-nginxpod-template-hash57b7fd5644 Annotations: cni.projectcalico.org/containerID: c475d3e82ff0d5adbd35252ab990608ad75955f8d0862bb8b0c54ee60a0878ebcni.projectcalico.org/podIP: 10.1.43.223/32cni.projectcalico.org/podIPs: 10.1.43.223/32 Status: Running IP: 10.1.43.223 IPs:IP: 10.1.43.223 Controlled By: ReplicaSet/readiness-nginx-deployment-57b7fd5644 Containers:readiness-nginx-container:Container ID: containerd://5d82d8467bc6e0c8151e40ee3258d54bffec8659bcdad4a441848ea8f77a3223Image: nginxImage ID: docker.io/library/nginxsha256:67f9a4f10d147a6e04629340e6493c9703300ca23a2f7f3aa56fe615d75d31caPort: 80/TCPHost Port: 0/TCPCommand:/bin/sh-csleep 3; touch /tempdir/readiness-nginx; while true; do sleep 5; doneState: RunningStarted: Mon, 14 Aug 2023 14:35:30 0000Ready: TrueRestart Count: 0Readiness: exec [cat /tempdir/readiness-nginx] delay2s timeout1s period1s #success1 #failure6Environment: noneMounts:/tempdir from probe-volume (rw)/var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-c4tcl (ro) Conditions:Type StatusInitialized True Ready True ContainersReady True PodScheduled True Volumes:probe-volume:Type: EmptyDir (a temporary directory that shares a pods lifetime)Medium: MemorySizeLimit: 1Gikube-api-access-c4tcl:Type: Projected (a volume that contains injected data from multiple sources)TokenExpirationSeconds: 3607ConfigMapName: kube-root-ca.crtConfigMapOptional: nilDownwardAPI: true QoS Class: BestEffort Node-Selectors: none Tolerations: node.kubernetes.io/not-ready:NoExecute opExists for 300snode.kubernetes.io/unreachable:NoExecute opExists for 300s Events:Type Reason Age From Message---- ------ ---- ---- -------Warning Unhealthy 3m5s (x262 over 13m) kubelet Readiness probe failed: cat: /tempdir/readiness-nginx: No such file or directoryService也重新将其加回来了。 Name: readiness-nginx-service Namespace: default Labels: none Annotations: endpoints.kubernetes.io/last-change-trigger-time: 2023-08-14T14:48:23Z Subsets:Addresses: 10.1.209.155,10.1.43.223NotReadyAddresses: nonePorts:Name Port Protocol---- ---- --------unset 80 TCPEvents: none
http://www.hkea.cn/news/14572407/

相关文章:

  • 投资担保网站建设郑州网络营销外包顾问
  • 佛山网站建设锐艺传播wordpress模板怎么修改
  • 网站建设基础教程人教版做网站的搜索引擎
  • 朱腾鹏个人网站做网站公司宁波
  • 开贴纸网站要怎么做的wordpress怎样发邮件
  • wordpress和网站区别成都网站建设q479185700棒
  • 猎头公司找的工作怎么样网站seo的重要性
  • 矿山建设工程公司网站镇江市官网
  • 如何设计服装网站规划云南鼎润房地产开发有限公司网页设计
  • 度假村网站模板内账免费的财务软件
  • 南山做网站多少钱门户网站开发使用什么语言
  • 做网站收费标准点击量wordpress 调整字体
  • 企业网站备案要钱吗晋江做网站的公司哪家好
  • 网站类型怎么分北京网站设计联系方式
  • wordpress+音乐网上海seo外包
  • 公司网站如何制作seo外贸公司推广
  • 什么网站做视频给钱菲律宾菠菜网站建设
  • 杭州网站建设求职简历厦门思明区建设局网站
  • c语言做的网站电商数据
  • 网站affiliate怎么做?庆元建设局网站
  • 做软件营销网站怎么样网页动态设计怎么做
  • 农业网站建设方案 ppt模板网赌赢了钱被网站黑了需要怎么做
  • 网站建设组织机构网站点内页还是首页
  • aspcms网站无法打开自动提卡的网站怎么做的
  • 效果图网站推荐大全面包砖传奇手游官方网站
  • 十大拿货网站做市场浏览什么网站
  • 泰安网站建设优化案例报告如何申请注册企业邮箱
  • 微信公众号个人可以做网站么专业营销策划团队
  • 免费素材网站 可商用深圳住房和建设
  • 怎么做网站滑动图片部分湖北网官网