diff --git a/docs/images/helm-release-deployed.png b/docs/images/helm-release-deployed.png new file mode 100644 index 000000000..62a49954b Binary files /dev/null and b/docs/images/helm-release-deployed.png differ diff --git a/docs/images/helm-release-failed.png b/docs/images/helm-release-failed.png new file mode 100644 index 000000000..62d778f52 Binary files /dev/null and b/docs/images/helm-release-failed.png differ diff --git a/docs/images/helm-release-unhealthy.png b/docs/images/helm-release-unhealthy.png new file mode 100644 index 000000000..28894f1ee Binary files /dev/null and b/docs/images/helm-release-unhealthy.png differ diff --git a/docs/images/helm-release-uninstalled.png b/docs/images/helm-release-uninstalled.png new file mode 100644 index 000000000..e2aadece4 Binary files /dev/null and b/docs/images/helm-release-uninstalled.png differ diff --git a/docs/playbook-reference/triggers/helm-releases-monitoring.rst b/docs/playbook-reference/triggers/helm-releases-monitoring.rst new file mode 100644 index 000000000..e50feaed5 --- /dev/null +++ b/docs/playbook-reference/triggers/helm-releases-monitoring.rst @@ -0,0 +1,144 @@ +Helm Releases Monitoring +############################# + +Robusta can monitor your Helm releases and notify you about updates or problems. For example: + +* Get notified in Slack when a Helm release fails +* Get notified in MSTeams if a Helm release is pending for more than X seconds +* Send details on your Helm history to external tools + +…and more + +Prerequisites +--------------- +To use Helm Triggers, the :ref:`Robusta UI` sink must be enabled.. + +Triggers +----------- + +The following triggers are available: + +.. _on_helm_release_unhealthy: + +.. details:: on_helm_release_unhealthy + + + ``on_helm_release_unhealthy`` triggers when a Helm release remains unhealthy for over ``duration`` seconds. Unhealthy states are: ``uninstalling``, ``pending-install``, ``pending-upgrade``, and ``pending-rollback``. + + + **Available options**: + + * ``rate_limit``: Limit firing to once every `rate_limit` seconds. + * ``names``: List of Helm releases for this trigger to monitor. Leaving this field empty monitors all releases in the namespace. Optional. + * ``namespace``: The Kubernetes namespace for this trigger to monitor. Leaving this field empty monitors all namespaces in the cluster. Optional. + * ``duration``: Minimum time, in seconds, that a release must remain unhealthy before the trigger fires. If the unhealthy state lasts less than this duration, the trigger won't fire. Default value is 900 seconds (15 minutes). Optional. + + .. admonition:: Example + + Monitor the ``demo-app`` Helm release in the ``default`` namespace. Send notifications when it is unhealthy for more than 15 minutes (900 seconds). Do not send further notifications for at least 4 hours (14400 seconds). + + .. code-block:: yaml + + customPlaybooks: + - triggers: + - on_helm_release_unhealthy: + names: ["demo-app"] # optional + namespace: "default" # optional + duration: 900 # optional + rate_limit: 14400 + actions: + - helm_status_enricher: {} + + + .. image:: /images/helm-release-unhealthy.png + :width: 1000 + :align: center + + +.. _on_helm_release_fail: + +.. details:: on_helm_release_fail + + ``on_helm_release_fail`` is triggered when a Helm release enters a ``failed`` state. This is a one-time trigger, meaning that it only fires once when the release fails. + + **Available options**: + + * ``names``: List of Helm releases for this trigger to monitor. Leaving this field empty monitors all releases in the namespace. Optional. + * ``namespace``: The Kubernetes namespace for this trigger to monitor. Leaving this field empty monitors all namespaces in the cluster. Optional. + + .. admonition:: Example + + Monitor the ``demo-app`` Helm release in the ``default`` namespace and send notifications when it is failing. + + .. code-block:: yaml + + customPlaybooks: + - triggers: + - on_helm_release_fail: + names: ["demo-app"] # optional + namespace: "default" # optional + actions: + - helm_status_enricher: {} + + .. image:: /images/helm-release-failed.png + :width: 1000 + :align: center + +.. _on_helm_release_deploy: + +.. details:: on_helm_release_deploy + + The ``on_helm_release_deploy`` is triggered when a Helm release enters a ``deployed`` state. This is a one-time trigger, meaning that it only fires once when the release is successfully deployed. + + **Available options**: + + * ``names``: List of Helm releases for this trigger to monitor. Leaving this field empty monitors all releases in the namespace. Optional. + * ``namespace``: The Kubernetes namespace for this trigger to monitor. Leaving this field empty monitors all namespaces in the cluster. Optional. + + .. admonition:: Example + + Monitor the ``demo-app`` Helm release in the ``default`` namespace and send notifications when it is deployed. + + .. code-block:: yaml + + customPlaybooks: + - triggers: + - on_helm_release_deploy: + names: ["demo-app"] # optional + namespace: "default" # optional + actions: + - helm_status_enricher: {} + + .. image:: /images/helm-release-deployed.png + :width: 1000 + :align: center + + +.. _on_helm_release_uninstall: + +.. details:: on_helm_release_uninstall + + The ``on_helm_release_uninstall`` is triggered when a Helm release enters a ``uninstalled`` state. This is a one-time trigger, meaning that it only fires once when the release is uninstalled. + + **Available options**: + + * ``names``: List of Helm releases for this trigger to monitor. Leaving this field empty monitors all releases in the namespace. Optional. + * ``namespace``: The Kubernetes namespace for this trigger to monitor. Leaving this field empty monitors all namespaces in the cluster. Optional. + + .. admonition:: Example + + Monitor the ``demo-app`` Helm release in the ``default`` namespace and send notifications when it is uninstalled. + + .. code-block:: yaml + + customPlaybooks: + - triggers: + - on_helm_release_uninstall: + names: ["demo-app"] # optional + namespace: "default" # optional + actions: + - helm_status_enricher: {} + + .. image:: /images/helm-release-uninstalled.png + :width: 1000 + :align: center diff --git a/docs/playbook-reference/triggers/index.rst b/docs/playbook-reference/triggers/index.rst index a49a78cb3..13623511f 100644 --- a/docs/playbook-reference/triggers/index.rst +++ b/docs/playbook-reference/triggers/index.rst @@ -13,6 +13,7 @@ You can trigger Robusta playbooks on the following events: Kubernetes (API Server) Prometheus and AlertManager + Helm Releases Monitoring Scheduled Webhooks Manual Triggers @@ -32,6 +33,11 @@ You can trigger Robusta playbooks on the following events: :link: prometheus :link-type: doc + .. grid-item-card:: :octicon:`cpu;1em;` Helm Releases Monitoring + :class-card: sd-bg-light sd-bg-text-light + :link: helm-releases-monitoring + :link-type: doc + .. grid-item-card:: :octicon:`cpu;1em;` Scheduled Triggers :class-card: sd-bg-light sd-bg-text-light :link: scheduled @@ -41,7 +47,7 @@ You can trigger Robusta playbooks on the following events: :class-card: sd-bg-light sd-bg-text-light :link: webhook :link-type: doc - + .. grid-item-card:: :octicon:`cpu;1em;` Manual Triggers :class-card: sd-bg-light sd-bg-text-light :link: manual-triggers