A service to monitor the health of OpenWhisk clusters. This application continuously checks the availability of your clusters by invoking a mock function to each registered cluster, then stores the response over time to calculate a weekly availability score. Changes in the availability score are tracked and logged accordingly.
These instructions will help you set up and run the project on your local machine or in a Docker environment.
- Python 3.8 or later
- Docker (if you wish to run the app in a container)
- Clone the repository to your local machine.
- Navigate to the project directory and install the necessary Python packages using the following command:
pip install -r requirements.txt
Export environmental variable with Openwhisk URL and Credentials
CLUSTERS_CONFIG='{"cluster1": {"OW_URL": "<ow_url>","OW_CREDS": "<user>:<pass>"},"clusterN": {"OW_URL": "ow_url","OW_CREDS": "<ow_user>:<ow_pass>"}}'```
Start Monitoring
python3 app.py
- Make sure Docker is installed on your system.
- Build the Docker image using the following command in the project directory:
docker build -t cluster-availability-monitor .
docker run -d -e CLUSTERS_CONFIG='{"cluster1": {"OW_URL": "<ow_url>","OW_CREDS": "<user>:<pass>"},"clusterN": {"OW_URL": "ow_url","OW_CREDS": "<ow_user>:<ow_pass>"}}' cluster-availability-monitor
Before running the application, you must configure the OpenWhisk clusters to be monitored through the CLUSTERS_CONFIG environment variable. This JSON object should map cluster names to objects containing the OW_URL and OW_CREDS properties for each cluster.
Once installed, the application will start monitoring the availability of the specified OpenWhisk clusters with the availability scores every minute. It will log important information (i.e., updates in the scores) to the console.
It can be extended to update external services requiring such info.
To check the logs of the running Docker container, use the following command:
docker logs <CONTAINER_ID>
This project has been developed as part of the activities of the EU-funded PHYSICS project under grant agreement no 101017047.