About the /tmp/active Readiness Probe

This section discusses the definition of ready whereby the tt container providing the active database is the one considered ready.

The TimesTen Operator creates and manages a file called /tmp/active in the tt container's file system to determines if the tt container is ready. If the /tmp/active file exists, the tt container is ready. If the file does not exist, the tt container is not ready.

The TimesTen Operator provides and defines the /tmp/active readiness probe for this definition of ready. The TimesTen Operator enables this readiness probe by default for replicated TimesTenClassic objects. The definition is in YAML format and is as follows:

readinessProbe:
 exec:
   command: 
   - cat
   - /tmp/active
 failureThreshold: 1
 periodSeconds: 10
 successThreshold: 1

In this example, Kubernetes runs the cat command in the tt container every 10 seconds. If the command exits with a return code of 0, the container is ready. If the command returns any other value, the container is not ready.

Defining a readiness probe in this manner ensures that Kubernetes Services routes incoming client/server connections to databases that are working and that can be read and written. For more information about client/server connections, see About Using Client/Server Drivers.