oneks_monitor_observations - OpenNebula/cluster-api-provider-opennebula GitHub Wiki
OneKS Monitor Resource Observations
See OneKS Monitor Overview for an introduction to the component.
Resource observations allow selected Kubernetes fields to be displayed in OneKS. The monitor also reports Pending Pods automatically; no configuration is required for those observations.
Configuration
Custom observations are defined in the monitor.yaml entry of the
oneks-resource-monitor ConfigMap. By default, the ConfigMap is located in the
kube-system namespace.
apiVersion: v1
kind: ConfigMap
metadata:
name: oneks-resource-monitor
namespace: kube-system
data:
monitor.yaml: |
- apiVersion: apps/v1
resource: deployments
namespace: capone-system
name: capone-controller-manager
path: status.readyReplicas
Apply the document with kubectl:
kubectl apply -f oneks-resource-monitor.yaml
The monitor reloads the configuration automatically during its next resource poll.
Observation fields
Each entry supports the following fields:
| Field | Required | Description |
|---|---|---|
apiVersion |
Yes | Kubernetes API version, for example apps/v1. |
resource |
Yes | Plural API resource name, for example deployments. |
namespace |
No | Resource namespace. Leave empty for a cluster-scoped resource. |
name |
Yes | Name of the Kubernetes resource. |
path |
Yes | Dot-separated path to the field to observe. |
The selected value must be one of these scalar types:
- String.
- Integer or floating-point number.
- Boolean.
null.
Objects and arrays cannot be reported as observation values.
If the configured Kubernetes object or field does not exist, the monitor
reports a null value. The creation timestamp is also reported when the object
exists.
Examples
Deployment ready replicas
- apiVersion: apps/v1
resource: deployments
namespace: capone-system
name: capone-controller-manager
path: status.readyReplicas
Node schedulability
The namespace is empty because Nodes are cluster-scoped:
- apiVersion: v1
resource: nodes
namespace: ""
name: worker-0
path: spec.unschedulable
Custom resource status
Use the resource's API version and plural API name, not its kind:
- apiVersion: example.com/v1
resource: services
namespace: default
name: example-service
path: status.ready
Multiple observations
apiVersion: v1
kind: ConfigMap
metadata:
name: oneks-resource-monitor
namespace: kube-system
data:
monitor.yaml: |
- apiVersion: apps/v1
resource: deployments
namespace: capone-system
name: capone-controller-manager
path: status.readyReplicas
- apiVersion: v1
resource: nodes
namespace: ""
name: worker-0
path: spec.unschedulable
Validate the configuration
Inspect the active ConfigMap:
kubectl -n kube-system get configmap oneks-resource-monitor -o yaml
Review the monitor logs after changing it:
kubectl -n kube-system logs deployment/oneks-monitor
If a new document is invalid, the monitor logs the error and keeps using the last valid configuration. It does not publish a partial snapshot when one of the configured resources cannot be read.
Permissions
The monitor has read-only Kubernetes permissions. The requested resource must
be readable by the oneks-monitor ServiceAccount.
If an observation for a custom resource fails with a permission error, grant
only the required get, list, and watch permissions. Do not grant write
permissions or access to Secrets merely to create an observation.