Create "pacs server-status" command that can be used to determine if a cloud Orthanc instance is online and connected
Kubernetes has the ability to restart containers/pods if there is an issue. Implemented as "liveness", "readiness", and "startup" probes, probes are shell commands which run a check and return an exit code. If the probe command returns a non-zero exit code, Kubernetes will restart the program.
Liveness probes are needed for Orthanc and Soandor. These could be implemented using the CLI tool where an API request is made to a /status
endpoint that returns information about database connection, networking, and other parameters indicating the program is online and working as expected. If the API calls cannot be made, then the CLI tool could return a non-zero return code which would prompt Kubernetes to restart the containers in an effort to fix the problem.
Command:
python sonador-cli.py pacs server-status
Configuration:
- Provide Sonador connection parameters using existing environment variables in container definition (or via a secret)
- Providing imaging server to test via existing environment variable (or via a secret)
- Create container which includes the CLI tools
- Run the check every 30 seconds to provide an uptime check
- Pods are restarted if the CLI command returns a non-zero (error) status code