In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
After opening the probe, go to set up health check. Support the three methods described above: execute command check, TCP port check, and HTTP request check.
Select different check methods and enter different parameters, such as startup interval, check interval, response timeout, and other parameters. Take the HTTP request check method as an example:
The yaml file is automatically generated when the workload is created after the setting is completed. Take the newly created deployment as an example, the health check yaml file is generated as follows:
ApiVersion: apps/v1beta2kind: Deploymentmetadata: annotations: deployment.kubernetes.io/revision: "1" description: tke-health-check-demo creationTimestamp: "2019-09-30T12:28:42Z" generation: 1 labels: k8s-app: tke-health-check-demo qcloud-app: tke-health-check-demo name: tke-health-check-demo namespace: default resourceVersion: "2060365354" selfLink: / apis/apps/v1beta2/namespaces/default/deployments/tke-health- Check-demo uid: d6cf1f25-e37d-11e9-87fd-567eb17a3218spec: minReadySeconds: 10 progressDeadlineSeconds: 600 replicas: 1 revisionHistoryLimit: 10 selector: matchLabels: k8s-app: tke-health-check-demo qcloud-app: tke-health-check-demo strategy: rollingUpdate: maxSurge: 1 maxUnavailable: 0 type: RollingUpdate template: metadata: creationTimestamp: null labels: k8s-app: tke-health-check-demo qcloud-app: Tke-health-check-demo spec: containers:-image: nginx:latest imagePullPolicy: Always livenessProbe: # Health check mechanism generated by template failureThreshold: 1 httpGet: path: / port: 80 scheme: HTTP periodSeconds: 3 successThreshold: 1 timeoutSeconds: 2 name: tke- Health-check-demo resources: limits: cpu: 500m memory: 1Gi requests: cpu: 250m memory: 256Mi securityContext: privileged: false procMount: Default terminationMessagePath: / dev/termination-log terminationMessagePolicy: File dnsPolicy: ClusterFirst imagePullSecrets:-name: qcloudregistrykey-name: tencenthubkey RestartPolicy: Always schedulerName: default-scheduler securityContext: {} terminationGracePeriodSeconds: 30 write at the end
This chapter introduces two kinds of health check in kubernetes: Probe:livenessProbe and readinessProbe,livenessProbe are mainly used for survival check and check the internal running status of the container. Readiness is mainly used for ready check. Whether it can accept traffic or not, it usually needs to be combined with the endpoints of service. When ready, it is added to endpoints at that time, and deleted from endpoints when ready exception, thus realizing the health check and service detection mechanism of services. For Probe mechanism, three detection methods are provided, which are suitable for different scenarios: 1. Exec command line, through command or shell to achieve health check, 2. TcpSocket through TCP protocol detection port, establish tcp connection, 3. HttpGet through the establishment of http request detection, readers can master its usage.
Appendix
Health check: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
Setting method of TKE health check: https://cloud.tencent.com/document/product/457/32815
When your talent can't support your ambition, you should calm down and study.
Return to the kubernetes series tutorial directory
* * if you think the article is helpful to you, please subscribe to the column and share it with friends in need.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.