You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use this endpoint to retrieve an **active count of specific Kubernetes resources** within a namespace. This is the same data displayed in the **Namespaces** tab of the Robusta UI.
659
+
660
+
You can specify exactly which resource kinds you want to query in the request.
661
+
662
+
This API relies on resource types configured in the Robusta UI sink.
663
+
Make sure to configure them as described in :ref:`cb-robusta-ui-sink-namespace-config`.
664
+
665
+
Request Body Schema
666
+
^^^^^^^^^^^^^^^^^^^
667
+
668
+
The request body must include the following fields:
669
+
670
+
.. list-table::
671
+
:widths: 25 10 70 10
672
+
:header-rows: 1
673
+
674
+
* - Field
675
+
- Type
676
+
- Description
677
+
- Required
678
+
* - ``namespace``
679
+
- string
680
+
- The name of the namespace you want to inspect.
681
+
- Yes
682
+
* - ``account_id``
683
+
- string
684
+
- The unique account identifier.
685
+
- Yes
686
+
* - ``cluster_name``
687
+
- string
688
+
- The name of the cluster where the namespace resides.
689
+
- Yes
690
+
* - ``resources``
691
+
- list
692
+
- A list of resource types to count, each including ``kind``, ``apiGroup``, and ``apiVersion``.
693
+
- Yes
694
+
695
+
Each item in the ``resources`` list must include:
696
+
697
+
* ``kind`` (e.g., `Deployments`)
698
+
* ``apiGroup`` (e.g., `apps`, or empty string for core group)
699
+
* ``apiVersion`` (e.g., `v1`, `v2`)
700
+
701
+
Example Request
702
+
^^^^^^^^^^^^^^^^^^^^
703
+
704
+
Here is an example of a ``POST`` request to query the resource count in a namespace:
Copy file name to clipboardExpand all lines: docs/configuration/sinks/RobustaUI.rst
+40Lines changed: 40 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,6 +60,46 @@ To do so, configure a shorter retention period by setting the ``ttl_hours`` in t
60
60
# automatically clean up old clusters in the UI if they are disconnected 12+ hours
61
61
ttl_hours: 12
62
62
63
+
64
+
.. _cb-robusta-ui-sink-namespace-config:
65
+
66
+
Monitoring Specific Resources in Namespaces
67
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
68
+
69
+
By default, the Robusta UI sink discovers the standard resources in all namespaces using the standard discovery interval.
70
+
However, we have a configuration to monitor custom namespaced resources, and an API is exposed via the the Robusta Backend to see how many of each resource you have in a namespace.
71
+
72
+
To configure this, use the ``namespace_discovery_seconds`` and ``namespaceMonitoredResources`` settings in the Robusta UI sink:
73
+
74
+
.. code-block:: bash
75
+
:name: cb-robusta-ui-sink-namespace-config-code
76
+
77
+
sinksConfig:
78
+
- robusta_sink:
79
+
name: robusta_ui_sink
80
+
token: <your-token>
81
+
# how often to re-scan for new namespaces (in seconds)
82
+
namespace_discovery_seconds: 3600
83
+
# what resource types to actively count per namespace
84
+
namespaceMonitoredResources:
85
+
- apiGroup: ""
86
+
apiVersion: "v1"
87
+
kind: "Services"
88
+
- apiGroup: "apps"
89
+
apiVersion: "v1"
90
+
kind: "Deployments"
91
+
- apiGroup: "apps.openshift.io"
92
+
apiVersion: "v1"
93
+
kind: "DeploymentConfig"
94
+
- apiGroup: "batch"
95
+
apiVersion: "v1"
96
+
kind: "CronJob"
97
+
- apiGroup: "networking.k8s.io"
98
+
apiVersion: "v1"
99
+
kind: "Ingress"
100
+
101
+
102
+
63
103
More Information about the UI
64
104
-------------------------------------
65
105
For more information on UI features, view `robusta.dev <https://home.robusta.dev>`_.
0 commit comments