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

思行做网站深圳seo教程

思行做网站,深圳seo教程,资料代做网站,重庆施工员证书查询网文章目录 探针的使用容器探针启动实验1-启动探针的使用-startupprobeLiveness Probes 和 Readiness Probes演示若存在started.html 则进行 探针的使用 kubectl edit deploy -n kube-system corednslivenessprobe 的使用 livenessProbe:failureThreshold: 5httpGet:path: /heal…

文章目录

        • 探针的使用
          • 容器探针启动实验1-启动探针的使用-startupprobe
          • Liveness Probes 和 Readiness Probes
            • 演示
            • 若存在started.html 则进行

探针的使用
kubectl edit deploy -n kube-system corednslivenessprobe 的使用 livenessProbe:failureThreshold: 5httpGet:path: /healthport: 8080scheme: HTTPinitialDelaySeconds: 60periodSeconds: 10successThreshold: 1timeoutSeconds: 5readinessProbereadinessProbe:failureThreshold: 3httpGet:path: /readyport: 8181scheme: HTTPperiodSeconds: 10successThreshold: 1timeoutSeconds: 1kubectl edit po nginx kubectl describe po nginx-daemon
最下面有容器启动时候相关日志
容器探针启动实验1-启动探针的使用-startupprobe
Events:Type     Reason     Age               From               Message----     ------     ----              ----               -------Normal   Scheduled  20s               default-scheduler  Successfully assigned default/my-pod1 to ha2.example.localNormal   Pulled     20s               kubelet            Container image "nginx:1.7.9" already present on machineNormal   Created    20s               kubelet            Created container nginxNormal   Started    20s               kubelet            Started container nginxWarning  Unhealthy  4s (x2 over 14s)  kubelet            Startup probe failed: HTTP probe failed with statuscode: 404
[root@kubeadm-master1 test]# kubectl get pod
NAME                                 READY   STATUS    RESTARTS   AGE
client                               1/1     Running   0          48d
my-pod                               1/1     Running   0          7d23h
my-pod1                              0/1     Running   0          37s
net-test1                            1/1     Running   133        55d
net-test2                            1/1     Running   13         55d
nginx-deployment-67dfd6c8f9-5s6nz    1/1     Running   1          55d
tomcat-deployment-6c44f58b47-4pz6d   1/1     Running   1          55d
[root@kubeadm-master1 test]# kubectl get pod
NAME                                 READY   STATUS    RESTARTS   AGE
client                               1/1     Running   0          48d
my-pod                               1/1     Running   0          7d23h
my-pod1                              0/1     Running   0          42s
net-test1                            1/1     Running   133        55d
net-test2                            1/1     Running   13         55d
nginx-deployment-67dfd6c8f9-5s6nz    1/1     Running   1          55d
tomcat-deployment-6c44f58b47-4pz6d   1/1     Running   1          55d
[root@kubeadm-master1 test]# cat nginx-po.yaml
apiVersion: v1
kind: Pod
metadata:name: my-pod1labels:type: apptest: "1.0.0"namespace: default
spec:containers:- name: nginximage: nginx:1.7.9imagePullPolicy: IfNotPresentcommand:- nginx- -g- 'daemon off;'workingDir: /usr/share/nginx/htmlports:- name: httpcontainerPort: 80protocol: TCPenv:- name: JVM_OPTSvalue: '-Xms128m -Xmx128m'resources:requests:cpu: 100mmemory: 128Milimits:cpu: 200mmemory: 256MistartupProbe:httpGet:path: /api/pathport: 80failureThreshold: 3periodSeconds: 10successThreshold: 1timeoutSeconds: 5restartPolicy: OnFailure
Liveness Probes 和 Readiness Probes
用于检查容器是否还在运行。如果 liveness 探针失败,Kubernetes 将杀死容器,并根据其重启策略来处理。
用于检查容器是否已经准备好接收流量。如果 readiness 探针失败,Kubernetes 将不会将流量路由到该容器。定义了一个 startupProbe,它在容器启动后通过 HTTP GET 请求检查 /api/path 端点。现在我们将添加 livenessProbe 和 readinessProbe。一个 livenessProbe 可以如下定义:livenessProbe:httpGet:path: /api/healthport: 80initialDelaySeconds: 30periodSeconds: 10
这个 livenessProbe 会在容器启动后的30秒开始工作,每10秒检查一次 /api/health 端点。一个 readinessProbe 可以如下定义:readinessProbe:httpGet:path: /api/readyport: 80initialDelaySeconds: 5periodSeconds: 5
这个 readinessProbe 会在容器启动后的5秒开始工作,每5秒检查一次 /api/ready 端点。
演示
[root@kubeadm-master1 test]# cat liveness.yml
apiVersion: v1
kind: Pod
metadata:name: my-pod1labels:type: apptest: "1.0.0"namespace: default
spec:containers:- name: nginximage: nginx:1.7.9imagePullPolicy: IfNotPresentcommand:- nginx- -g- 'daemon off;'workingDir: /usr/share/nginx/htmlports:- name: httpcontainerPort: 80protocol: TCPenv:- name: JVM_OPTSvalue: '-Xms128m -Xmx128m'resources:requests:cpu: 100mmemory: 128Milimits:cpu: 200mmemory: 256MistartupProbe:httpGet:path: /api/pathport: 80failureThreshold: 3periodSeconds: 10successThreshold: 1timeoutSeconds: 5livenessProbe:httpGet:path: /api/healthport: 80initialDelaySeconds: 30periodSeconds: 10readinessProbe:httpGet:path: /api/readyport: 80initialDelaySeconds: 5periodSeconds: 5restartPolicy: OnFailureState:          RunningStarted:      Thu, 15 Feb 2024 15:15:19 +0800Ready:          FalseRestart Count:  0Limits:cpu:     200mmemory:  256MiRequests:cpu:      100mmemory:   128MiLiveness:   http-get http://:80/api/health delay=30s timeout=1s period=10s #success=1 #failure=3Readiness:  http-get http://:80/api/ready delay=5s timeout=1s period=5s #success=1 #failure=3Startup:    http-get http://:80/api/path delay=0s timeout=5s period=10s #success=1 #failure=3Environment:JVM_OPTS:  -Xms128m -Xmx128mMounts:/var/run/secrets/kubernetes.io/serviceaccount from default-token-75cq9 (ro)
Conditions:Type              StatusInitialized       TrueReady             FalseContainersReady   FalsePodScheduled      True
Volumes:default-token-75cq9:Type:        Secret (a volume populated by a Secret)SecretName:  default-token-75cq9Optional:    false
QoS Class:       Burstable
Node-Selectors:  <none>
Tolerations:     node.kubernetes.io/not-ready:NoExecute op=Exists for 300snode.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:Type     Reason     Age               From               Message----     ------     ----              ----               -------Normal   Scheduled  19s               default-scheduler  Successfully assigned default/my-pod1 to ha2.example.localNormal   Pulled     19s               kubelet            Container image "nginx:1.7.9" already present on machineNormal   Created    19s               kubelet            Created container nginxNormal   Started    19s               kubelet            Started container nginxWarning  Unhealthy  2s (x2 over 12s)  kubelet            Startup probe failed: HTTP probe failed with statuscode: 404
若存在started.html 则进行

在这里插入图片描述

http://www.tj-hxxt.cn/news/111975.html

相关文章:

  • 企业网站建设上市公司网络精准推广
  • 广西金水建设开发有限公司网站百度关键词查询
  • 搜网站内容优化疫情政策
  • 分销平台火车票操作湖南关键词优化快速
  • 小说网站开发实训报告公司网站制作网络公司
  • 广州网络优化最早的公司免费使用seo软件
  • wordpress字体怎么改seo营销名词解释
  • vs2013 做网站专门发广告的app
  • 网站的页头页脚怎么做推广app网站
  • 公司如何建立微网站如何推广公司网站
  • 360推广 网站建设长尾关键词排名工具
  • 长葛做网站百度人工电话
  • 深圳知名网站建设哪家好爱站网站长百度查询权重
  • 做网站app网站域名在哪里查询
  • 公司网站建设要注意什么问题百度seo排名培训
  • 做网站工作东莞建设网
  • 外贸网页制作公司seo网络优化招聘信息
  • 买房子上哪个网站最好爱站工具查询
  • 广州网站定做互联网营销渠道有哪些
  • 优质的聊城做网站2345浏览器主页网址
  • 商业网站建设知识点湖北百度推广电话
  • wordpress 信息字段seo独立站
  • 怎么再各网站上做宣传百度开户代理商
  • 深圳哪个做网站好优化网站建设开发
  • 做的网站如何发更新关键词seo排名怎么样
  • 微网站建设方案书seo排名点击 seo查询
  • 家装效果图网站seo诊断优化方案
  • 使用angularjs的网站霸屏推广
  • 平面设计师灵感网站冯耀宗seo视频教程
  • 公司形象墙设计效果图大全360优化大师官方最新