I have k8s pods deployed with following readiness probe,
readinessProbe:
tcpSocket:
port: 1234
initialDelaySeconds: 15
periodSeconds: 2
How costly the tcpSocket
probe is?
To monitor that port, I want to probe with minimum delay ( like making it 1 sec)
From the Docs:
A third type of liveness probe uses a TCP Socket. With this configuration, the kubelet will attempt to open a socket to your container on the specified port. If it can establish a connection, the container is considered healthy, if it can’t it is considered a failure.
So, essentially you need something to accept TCP connections on the given port from inside your Pod (i.e. using a Sidecar Container). Opening a Socket is not costly at all, it will - depending on your network - usually finish rather in milliseconds than in seconds.
However, it also depends on the service behind that Pod port. If it requires lots of resources, it may have an impact on your setup. If it's just accepting connections on the very port, everything should be fine.