- Getting Started with Kubernetes(Second Edition)
- Jonathan Baier
- 65字
- 2021-07-02 22:51:29
TCP checks
Kubernetes also supports health checks via simple TCP socket checks and also with custom command-line scripts. The following snippets are examples of what both use cases look like in the YAML file:
livenessProbe:
exec:
command:
-/usr/bin/health/checkHttpServce.sh
initialDelaySeconds:90
timeoutSeconds: 1
Listing 2-9: Health check using command-line script
livenessProbe:
tcpSocket:
port: 80
initialDelaySeconds: 15
timeoutSeconds: 1
Listing 2-10: Health check using simple TCP Socket connection