A GNOME Shell extension that displays OpenShift cluster alerts in your desktop panel. This extension monitors multiple OpenShift clusters and provides real-time alert notifications.
- Visual Status Indicator: Shows overall cluster health at a glance
- π’ Green: All clusters healthy
- π‘ Yellow: One or more clusters unreachable
- π΄ Red: Active alerts detected
- Multi-Cluster Support: Monitor multiple OpenShift clusters simultaneously
- Popup Menu: Click the indicator to see detailed alert information
- Auto-Refresh: Automatically checks for new alerts every 60 seconds
- Configurable: Filter alerts by severity (critical, warning, etc.)
- GNOME Shell 48+
- OpenShift cluster access with valid API tokens (see RBAC section below)
- Network connectivity to the cluster's Alertmanager endpoints
The extension can be installed via the GNOME Extensions manager, or via a web browser @ https://extensions.gnome.org/extension/9326/openshift-alerts/.
Alternatively, it can be installed from this repo:
./install.shThe extension requires a valid OpenShift API token to access the cluster. To keep things simple, create a service account with AlertManager access, and generate a token:
cat << EOF | oc apply -f -
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: ocp-alerts
namespace: openshift-monitoring
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: ocp-alerts
namespace: openshift-monitoring
rules:
- apiGroups:
- monitoring.coreos.com
resourceNames:
- main
resources:
- alertmanagers/api
verbs:
- 'list'
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: ocp-alerts
namespace: openshift-monitoring
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: monitoring-alertmanager-edit
subjects:
- kind: ServiceAccount
name: ocp-alerts
namespace: openshift-monitoring
EOFThen to generate a token:
oc create token ocp-alerts --duration=$((365*24))hNOTE: This will create a token that is valid for a year. Alter the --duration argument for a token of different length.
Create the configuration directory and file:
mkdir -p ~/.config/ocp-alerts
cp clusters.yaml.example ~/.config/ocp-alerts/clusters.yamlEdit ~/.config/ocp-alerts/clusters.yaml with your cluster information:
clusters:
my-cluster:
url: https://alertmanager-main-openshift-monitoring.apps.mycluster.example.com
token: <service-account-token>
severity: [critical, warning]NOTE The AlertManager URL can be discovered by
oc get route alertmanager-main -n openshift-monitoring -o jsonpath='{.spec.host}'
After copying the files and configuring your clusters:
# Restart GNOME Shell
# On Wayland: Log out and log back in
# On X11: Press Alt+F2, type 'r', and press Enter
# Enable the extension
gnome-extensions enable openshift-alerts@dcritch.github.comOr use GNOME Extensions app to enable it.
The configuration file uses YAML format:
clusters:
cluster-name:
url: <alertmanager-url>
token: <api-token>
severity: [critical, warning, info]Parameters:
cluster-name: A friendly name for your cluster (displayed in the menu)url: The Alertmanager API endpoint URLtoken: Your OpenShift API tokenseverity: Array of severity levels to monitor (critical, warning, info)
You can monitor multiple clusters by adding additional entries:
clusters:
production:
url: https://alertmanager.prod.example.com
token: sha256~prod-token
severity: [critical, warning]
staging:
url: https://alertmanager.staging.example.com
token: sha256~staging-token
severity: [critical]
development:
url: https://alertmanager.dev.example.com
token: sha256~dev-token
severity: [critical, warning]-
Status Indicator: The emoji in your panel shows the overall status:
- π’ All clusters are healthy
- π‘ At least one cluster is unreachable
- π΄ Active alerts are present
-
View Alerts: Click the status indicator to open the menu and see:
- Alert counts per cluster
- Detailed alert information
- Alert names and descriptions
-
Manual Refresh: Click "β» Refresh" in the menu to immediately check for new alerts
-
Check that files are in the correct location:
ls ~/.local/share/gnome-shell/extensions/openshift-alerts@dcritch.github.com/ -
Check for errors in the logs:
journalctl -f -o cat /usr/bin/gnome-shell
-
Verify the extension is enabled:
gnome-extensions list --enabled
-
Verify your config file exists and is valid:
cat ~/.config/ocp-alerts/clusters.yaml -
Test connectivity to your cluster:
curl -k -H "Authorization: Bearer YOUR_TOKEN" \ https://alertmanager-url/api/v2/alerts -
Check the GNOME Shell logs for errors:
journalctl -f -o cat /usr/bin/gnome-shell | grep -i openshift
By default, the extension accepts all SSL certificates, including self-signed ones. This is configured in extension.js using libsoup3's accept-certificate signal handler.
To disable SSL verification (current default):
The extension currently includes this code in the _fetchAlertsForCluster method:
// Accept all certificates (including self-signed)
message.connect('accept-certificate', () => {
return true;
});To enable strict SSL verification:
Remove or comment out the accept-certificate signal handler in extension.js:
// Strict SSL verification - comment out or remove this block:
// message.connect('accept-certificate', () => {
// return true;
// });Alternatively, you can make it conditional based on certificate validation:
// Only accept valid certificates or specific self-signed ones
message.connect('accept-certificate', (message, cert, errors) => {
// Log the certificate errors for debugging
log(`Certificate errors: ${errors}`);
// Return false to enforce strict SSL verification
// Return true to accept the certificate
return false; // Change to 'true' to accept self-signed certs
});After modifying the code, restart GNOME Shell or re-enable the extension for changes to take effect.
To see debug output:
# Watch GNOME Shell logs
journalctl -f -o cat /usr/bin/gnome-shell
# Or use Looking Glass (Alt+F2, type 'lg')
# Then check the Extensions tabAfter making changes:
# Disable
gnome-extensions disable openshift-alerts@dcritch.github.com
# Re-enable
gnome-extensions enable openshift-alerts@dcritch.github.comMIT License - Feel free to modify and distribute as needed.
Contributions are welcome! Please feel free to submit issues or pull requests.
- Original Argos Python script: ocp-alerts.py
- OpenShift Documentation: https://docs.openshift.com/
- Testing and working under GNOME Shell 50
- Use a file for the icon rather than an embedded SVG
- Testing and working under GNOME Shell 49
- Initial release
- Support for GNOME Shell 48
- Multi-cluster monitoring
- Configurable severity filtering
- Auto-refresh every 60 seconds
