|
| 1 | +============================================= |
| 2 | +Custom Resource Definitions (CRDs) Monitoring |
| 3 | +============================================= |
| 4 | + |
| 5 | +Overview |
| 6 | +-------- |
| 7 | + |
| 8 | +The CRDs monitoring feature enables you to view and manage Custom Resource Definitions and their instances directly from the Robusta UI. This powerful feature provides visibility into: |
| 9 | + |
| 10 | +* All CRDs deployed in your clusters |
| 11 | +* Individual CR (Custom Resource) instances and their status |
| 12 | +* Resource events and history |
| 13 | +* Full YAML manifests |
| 14 | +* Detailed resource descriptions |
| 15 | + |
| 16 | +Prerequisites |
| 17 | +------------- |
| 18 | + |
| 19 | +To enable CRD monitoring, the Robusta agent needs appropriate permissions to read custom resources in your cluster. This requires adding cluster role rules to your Robusta configuration. |
| 20 | + |
| 21 | +Configuration |
| 22 | +------------- |
| 23 | + |
| 24 | +Basic Configuration |
| 25 | +^^^^^^^^^^^^^^^^^^^ |
| 26 | + |
| 27 | +Specify read permissions for the CRDs you need to monitor: |
| 28 | + |
| 29 | +.. code-block:: yaml |
| 30 | +
|
| 31 | + runner: |
| 32 | + customClusterRoleRules: |
| 33 | + - apiGroups: |
| 34 | + - "cert-manager.io" |
| 35 | + resources: |
| 36 | + - "certificates" |
| 37 | + - "certificaterequests" |
| 38 | + - "issuers" |
| 39 | + - "clusterissuers" |
| 40 | + verbs: |
| 41 | + - "list" |
| 42 | + - "get" |
| 43 | + - apiGroups: |
| 44 | + - "acme.cert-manager.io" |
| 45 | + resources: |
| 46 | + - "challenges" |
| 47 | + - "orders" |
| 48 | + verbs: |
| 49 | + - "list" |
| 50 | + - "get" |
| 51 | +
|
| 52 | +Applying the Configuration |
| 53 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 54 | + |
| 55 | +1. Update your ``values.yaml`` file with the desired configuration |
| 56 | +2. Apply the changes using Helm: |
| 57 | + |
| 58 | +.. code-block:: bash |
| 59 | +
|
| 60 | + helm upgrade robusta robusta/robusta \ |
| 61 | + --values values.yaml \ |
| 62 | + --namespace robusta \ |
| 63 | + --reuse-values |
| 64 | +
|
| 65 | +Automatic Configuration with Holmes AI |
| 66 | +--------------------------------------- |
| 67 | + |
| 68 | +Instead of manually configuring permissions for each CRD, you can use Holmes AI to automatically generate the configuration for all CRDs in your cluster. |
| 69 | + |
| 70 | +Using Holmes to Generate Configuration |
| 71 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 72 | + |
| 73 | +1. Navigate to the **Holmes Ask** page in the Robusta UI |
| 74 | +2. Use the following prompt: |
| 75 | + |
| 76 | +.. code-block:: text |
| 77 | +
|
| 78 | + I want to add read only cluster roles for all the crds in my cluster. |
| 79 | + This is the format for adding one: |
| 80 | + runner: |
| 81 | + customClusterRoleRules: |
| 82 | + - apiGroups: |
| 83 | + - "storage.k8s.io" |
| 84 | + resources: |
| 85 | + - "storageclasses" |
| 86 | + verbs: |
| 87 | + - "list" |
| 88 | + - "get" |
| 89 | + Prepare my config |
| 90 | +
|
| 91 | +3. Holmes will analyze your cluster and generate a complete configuration including all CRDs |
| 92 | +4. Copy the generated configuration and add it to your ``values.yaml`` |
| 93 | +5. Apply the configuration using Helm as described above |
| 94 | + |
| 95 | +.. tip:: |
| 96 | + After Holmes generates the configuration, you can review and modify it to remove any CRDs you don't want to monitor before applying it. |
| 97 | + |
| 98 | +Troubleshooting |
| 99 | +--------------- |
| 100 | + |
| 101 | +Common Issues and Solutions |
| 102 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 103 | + |
| 104 | +**Issue 1: CRDs not appearing in UI** |
| 105 | + |
| 106 | +* **Check permissions**: Verify the ClusterRole has the correct permissions |
| 107 | + |
| 108 | + .. code-block:: bash |
| 109 | +
|
| 110 | + kubectl get clusterrole robusta-runner -o yaml |
| 111 | +
|
| 112 | +* **Check agent logs**: Look for permission errors |
| 113 | + |
| 114 | + .. code-block:: bash |
| 115 | +
|
| 116 | + kubectl logs -n robusta deployment/robusta-runner | grep -i "forbidden" |
| 117 | +
|
| 118 | +**Issue 2: "Forbidden" errors when accessing CRDs** |
| 119 | + |
| 120 | +* **Solution**: Add the specific apiGroup and resource to ``customClusterRoleRules`` |
| 121 | +* **Example error**: ``cannot get resource "certificates" in API group "cert-manager.io"`` |
| 122 | +* **Fix**: Add the cert-manager.io apiGroup with certificates resource |
| 123 | + |
0 commit comments