Get the App
SLTechnology News&Howtos  ›  Servers  › 

The usage of tcp Survival Detection in K8s

Shulou Source: shulou.com Published: 2022-06-03 06:08:01 10月03日 Update

This article mainly introduces in detail the use of tcp survival detection in k8s, the sample code in this article is very detailed, zero basis can also refer to this article, interested friends can refer to it.

apiVersion: v1kind: Podmetadata: name: liveness-tcp namespace: defaultspec: containers: - name: liveness-tcp-container image: httpd imagePullPolicy: IfNotPresent livenessProbe: initialDelaySeconds: 5 timeoutSeconds: 10 tcpSocket: port: 8080 periodSeconds: 3

The default port of the image should be 80, but the yaml file is deliberately written as 8080, tcp detection fails, pod will repeatedly restart until port 80 is detected.

After reading the above, do you know how to use tcp survival detection in k8s? If you still want to learn more skills or want to know more related content, welcome to pay attention to the industry information channel, thank you for reading!

Tags: Detection usage method content more ports codes interests basics guys partners skills documents examples articles references industries information channels mirrors Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi MariaDB Docker Linux vpn