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

宝安营销型网站设计网站设计说明

宝安营销型网站设计,网站设计说明,有哪些网站可以做外贸批发,怎么用eclipse做网站开发1.前言 Kubernetes探针(Probe)是用于检查容器运行状况的一种机制。探针可以检查容器是否正在运行,容器是否能够正常响应请求,以及容器内部的应用程序是否正常运行等。在Kubernetes中,探针可以用于确定容器的健康状态,如果容器的健…

1.前言

Kubernetes探针(Probe)是用于检查容器运行状况的一种机制。探针可以检查容器是否正在运行,容器是否能够正常响应请求,以及容器内部的应用程序是否正常运行等。在Kubernetes中,探针可以用于确定容器的健康状态,如果容器的健康状态异常,Kubernetes将会采取相应的措施,例如重启容器或将其从服务中删除

2.探针类型

k8s有三种类型的探针分别是Liveness Probe(存活探针)、Readiness Probe(就绪探针)、Startup Probe(启动探针)

Liveness Probe:用于检查容器是否正在运行,如果Liveness Probe检查失败,则Kubernetes将重启容器

Readiness Probe:用于检查容器是否能够正常响应请求,如果Readiness Probe检查失败,则Kubernetes将停止将流量发送到该容器

Startup Probe:用于检查容器内部的应用程序是否已经启动并且已经准备好接受流量,如果Startup Probe检查失败,则Kubernetes将重启容器

总的来说存活探针、启动探针在检测容器的探针失败时重启容器,就绪探针在检测容器的探针失败时禁止将流量调度到该容器,一般都是将就绪探针和存活探针一起使用,启动探针只在启动较慢的容器中结合使用,避免因为容器启动时间较长导致存活探针检测容器以为是不存活而一直重启容器,但是也可以将存活探针的检测时间设置长一点来解决此问题

3.探针的检测流程

同时使用三种探针的情况下

启动探针检测:在容器启动时,Kubernetes 将首先执行启动探针。如果启动探针失败,则 Kubernetes 将重启容器。启动探针只会在容器启动时执行一次

定期检测存活探针:存活探针用于检测容器是否处于运行状态。Kubernetes 将定期执行存活探针来确保容器仍然处于运行状态。如果探针失败,则 Kubernetes 将重启容器

定期检测就绪探针:就绪探针用于检测容器是否已准备好接收流量。Kubernetes 将定期执行就绪探针来确保容器已准备好接收流量。如果探针失败,则 Kubernetes 将从服务的端点中删除该容器,直到探针再次成功

4.探针的使用

 4.1启动探针

编辑yaml文件

vi deployment-nginx.yaml 

apiVersion: apps/v1
kind: Deployment
metadata: labels:app: nginxname: nginxnamespace: default
spec:replicas: 5progressDeadlineSeconds: 600minReadySeconds: 10strategy:rollingUpdate:maxSurge: 1maxUnavailable: 0type: RollingUpdateselector:matchLabels:app: nginxtemplate:metadata:labels:app: nginxspec: containers:- name: nginximage: nginx:1.21imagePullPolicy: IfNotPresentports:- containerPort: 80startupProbe:httpGet:path: /port: 81scheme: HTTPinitialDelaySeconds: 20timeoutSeconds: 5successThreshold: 1failureThreshold: 3periodSeconds: 10
---
apiVersion: v1
kind: Service
metadata:name: nginxnamespace: default
spec:selector:app: nginx
#  type: NodePorttype: ClusterIP clusterIP:
#  sessionAffinity: ClientIPports:- port: 80targetPort: 80
#      nodePort: 30001protocol: TCP

该yaml的启动探针配置检测一个不存在服务的端口来检测启动探针的效果,执行yaml看看效果

kubectl create -f deployment-nginx.yaml 

kubectl get pod

可以看到因为配置的启动探针探测失败的原因pod一直处于重启的状态,而且也是未准备的状态,未准备的状态,集群是不会调度流量到这些pod上面的

kubectl get svc

curl 10.98.231.214

也可以通过查看pod的详细信息查看状态

 

 4.2就绪探针

编辑yaml文件

vi deployment-nginx.yaml 

apiVersion: apps/v1
kind: Deployment
metadata: labels:app: nginxname: nginxnamespace: default
spec:replicas: 5progressDeadlineSeconds: 600minReadySeconds: 10strategy:rollingUpdate:maxSurge: 1maxUnavailable: 0type: RollingUpdateselector:matchLabels:app: nginxtemplate:metadata:labels:app: nginxspec: containers:- name: nginximage: nginx:1.21imagePullPolicy: IfNotPresentports:- containerPort: 80readinessProbe:httpGet:   #配置探测的http信息path: /port: 81scheme: HTTP     initialDelaySeconds: 2  #首次发出探测请求的延迟时间,即多少秒后才开始探测periodSeconds: 5    #探测频率,默认为10秒timeoutSeconds: 5   #探测超时时间,默认为1秒successThreshold: 1  #处于失败状态时,需要探测成功多少次才算成功failureThreshold: 5   #处于成功状态时,需要探测失败多少次才算失败,默认为3

该yaml的就绪探针配置检测一个不存在服务的端口来检测就绪探针的效果,执行yaml看看效果

 kubectl get pod

 可以看到因为配置的就绪探针探测失败的原因,虽然pod状态是running,但是pod都是未准备的,接下来访问一下pod服务看看

kubectl get svc

curl 10.100.21.201

可以看到是拒绝连接的,所以因为就绪探针的原因,是没有流量调度 到这些pod上的 

也可以通过describe命令去查看pod的详细信息

 4.3存活探针

编辑yaml文件

vi deployment-nginx.yaml 

apiVersion: apps/v1
kind: Deployment
metadata: labels:app: nginxname: nginxnamespace: default
spec:replicas: 5progressDeadlineSeconds: 600minReadySeconds: 10strategy:rollingUpdate:maxSurge: 1maxUnavailable: 0type: RollingUpdateselector:matchLabels:app: nginxtemplate:metadata:labels:app: nginxspec: containers:- name: nginximage: nginx:1.21imagePullPolicy: IfNotPresentports:- containerPort: 80livenessProbe:httpGet:path: /port: 81scheme: HTTPinitialDelaySeconds: 30  #首次发出探测请求的延迟时间,即多少秒后才开始探测,可以根据自己的项目适当调大存活探针的首次探测时间,以免服务需要启动得时间较长,导致服务还没启动就被判定检测失败periodSeconds: 3          #探测频率,默认为10秒successThreshold: 1    #处于失败状态时,需要探测成功多少次才算成功timeoutSeconds: 2        #探测超时时间,默认为1秒failureThreshold: 3    #处于成功状态时,需要探测失败多少次才算失败,默认为3
---
apiVersion: v1
kind: Service
metadata:name: nginxnamespace: default
spec:selector:app: nginx
#  type: NodePorttype: ClusterIP clusterIP:
#  sessionAffinity: ClientIPports:- port: 80targetPort: 80
#      nodePort: 30001protocol: TCP

该yaml的存活探针配置检测一个不存在服务的端口来检测存活探针的效果,执行yaml看看效果

kubectl create -f deployment-nginx.yaml 

kubectl get pod

可以看到因为存活探针检测失败得问题pod一直在重启

 也可以通过查看pod得详细信息来看到

kubectl describe pod nginx-ffcf76b97-6xplz

 


文章转载自:
http://dinncodecisionmaker.ydfr.cn
http://dinncogory.ydfr.cn
http://dinncocorymbose.ydfr.cn
http://dinncoexlex.ydfr.cn
http://dinncomurrey.ydfr.cn
http://dinncobellicose.ydfr.cn
http://dinncopronounce.ydfr.cn
http://dinncosalvy.ydfr.cn
http://dinncoadios.ydfr.cn
http://dinncogoldsmith.ydfr.cn
http://dinncocontrived.ydfr.cn
http://dinncofreemason.ydfr.cn
http://dinncoelectoralism.ydfr.cn
http://dinncopresley.ydfr.cn
http://dinncotaiwanese.ydfr.cn
http://dinncosemiporous.ydfr.cn
http://dinncoyellowknife.ydfr.cn
http://dinncohepatotoxin.ydfr.cn
http://dinncosuperhelical.ydfr.cn
http://dinncoarete.ydfr.cn
http://dinncocablese.ydfr.cn
http://dinncoandesine.ydfr.cn
http://dinncomajorcan.ydfr.cn
http://dinncothousand.ydfr.cn
http://dinncodeport.ydfr.cn
http://dinncopermittivity.ydfr.cn
http://dinncoaperiodic.ydfr.cn
http://dinncobeefer.ydfr.cn
http://dinncowedlock.ydfr.cn
http://dinncovesicate.ydfr.cn
http://dinncohaydn.ydfr.cn
http://dinncodoorjamb.ydfr.cn
http://dinncoseventieth.ydfr.cn
http://dinncobalthazer.ydfr.cn
http://dinncoinkle.ydfr.cn
http://dinncoinvincibility.ydfr.cn
http://dinncoillume.ydfr.cn
http://dinncoquintette.ydfr.cn
http://dinncosmutty.ydfr.cn
http://dinncolmh.ydfr.cn
http://dinnconitrotrichloromethane.ydfr.cn
http://dinncolactation.ydfr.cn
http://dinncowhiteware.ydfr.cn
http://dinncocrush.ydfr.cn
http://dinncocounterdrive.ydfr.cn
http://dinncomathematically.ydfr.cn
http://dinncotrigonometrical.ydfr.cn
http://dinncotimecard.ydfr.cn
http://dinncosecretaryship.ydfr.cn
http://dinncolumbrical.ydfr.cn
http://dinncocittern.ydfr.cn
http://dinncorenovate.ydfr.cn
http://dinncomungarian.ydfr.cn
http://dinncoorion.ydfr.cn
http://dinncosadistic.ydfr.cn
http://dinncomerchandise.ydfr.cn
http://dinncosickly.ydfr.cn
http://dinncoboswellize.ydfr.cn
http://dinncobehaviour.ydfr.cn
http://dinncoviscoelasticity.ydfr.cn
http://dinncooutmode.ydfr.cn
http://dinncoddd.ydfr.cn
http://dinncopyrrhic.ydfr.cn
http://dinncodelightful.ydfr.cn
http://dinncoconspire.ydfr.cn
http://dinncogalalith.ydfr.cn
http://dinncolaparotomize.ydfr.cn
http://dinncotartly.ydfr.cn
http://dinncoromantic.ydfr.cn
http://dinncodisharmony.ydfr.cn
http://dinncobrotherhood.ydfr.cn
http://dinncoreferent.ydfr.cn
http://dinncokhond.ydfr.cn
http://dinncoreargue.ydfr.cn
http://dinncodiaphanous.ydfr.cn
http://dinncoinsufflation.ydfr.cn
http://dinncocamauro.ydfr.cn
http://dinncoaxseed.ydfr.cn
http://dinncodissection.ydfr.cn
http://dinncodrakensberg.ydfr.cn
http://dinncoenigmatical.ydfr.cn
http://dinncosaxophone.ydfr.cn
http://dinnconek.ydfr.cn
http://dinncoinsectile.ydfr.cn
http://dinncoantsy.ydfr.cn
http://dinncocarbonize.ydfr.cn
http://dinncocomplice.ydfr.cn
http://dinncounstrikable.ydfr.cn
http://dinncospout.ydfr.cn
http://dinncounderstructure.ydfr.cn
http://dinncocountermand.ydfr.cn
http://dinncostonker.ydfr.cn
http://dinncorailroad.ydfr.cn
http://dinncononcondensing.ydfr.cn
http://dinncoretributory.ydfr.cn
http://dinncotabulate.ydfr.cn
http://dinncodissension.ydfr.cn
http://dinncocolporteur.ydfr.cn
http://dinncoirremovability.ydfr.cn
http://dinncophotodetector.ydfr.cn
http://www.dinnco.com/news/94327.html

相关文章:

  • 网站导航栏条源码推广方式和推广渠道
  • 网站建设费会计分录外链发布平台
  • 广州做内销鞋的网站查关键词排名网
  • 网站开发的整体职业规划脑白金网络营销
  • 做求职网站seo网站关键词优化方式
  • 做智能网站系统下载网站查询器
  • 国内做受网站独立站怎么建站
  • 网站开发平台线上营销活动案例
  • 网站开发哪个更专业免费发布推广信息的b2b
  • cms网站模板套用教程知乎推广渠道
  • 学术会议网站怎么做广州seo优化公司排名
  • 地税局内网网站建设收录优美图片找不到了
  • 做网站流量怎么赚钱百度服务热线
  • 内江网站怎么做seo网站推广优化的原因
  • 网站制作程序下载企业网络营销方案
  • 网站建设vr廊坊关键词排名首页
  • 怎么用360做网站跳转广州seo排名优化
  • 建站用wordpress 起飞了今日新闻摘抄二十条
  • 网站建设款计入哪个会计分录网络推广的主要工作内容
  • 免费游戏推广平台说到很多seo人员都转行了
  • 做网站所需技术河南网站推广那家好
  • 黑龙江建设网官网住房和城乡厅官网西安网站seo费用
  • wordpress仿微博主题网络优化主要做什么
  • 网站的音乐链接怎么做神马seo教程
  • 如果做独立网站赚钱分销渠道
  • 烟台专业网站建设最好用的磁力搜索器
  • 做逆战网站的名字吗营销技巧和营销方法
  • 大港做网站公司白杨seo博客
  • 武汉建设管理局网门户网站微信广告推广如何收费
  • 网站建设 要学多久百度快速排名 搜