Portainer icon

Portainer

Interact with Portainer via API

Actions190

Kubernetes → Get Kubernetes Metrics For All Nodes

AI-generated

Overview

This node operation retrieves Kubernetes metrics for all nodes within a specified environment. It is useful for monitoring the health and performance of Kubernetes clusters by collecting metrics such as CPU usage, memory consumption, and other node-level statistics. Practical applications include automated cluster monitoring, alerting based on resource usage thresholds, and integration with dashboards or reporting tools.

Properties

Name Meaning
Id Environment identifier (a required numeric ID that specifies which Kubernetes environment to query for metrics)

Output

The output contains JSON data representing the metrics collected from all nodes in the specified Kubernetes environment. This typically includes various performance indicators per node, such as CPU load, memory usage, network statistics, and possibly other custom metrics exposed by the Kubernetes metrics API.

If binary data were involved (e.g., charts or logs), it would be summarized here, but this node focuses on JSON metric data only.

Dependencies

  • Requires an API key credential to authenticate requests to the Kubernetes environment.
  • The node depends on connectivity to the Kubernetes API server or a proxy service exposing the metrics endpoint.
  • Proper permissions must be granted to the API token used, allowing access to node metrics.
  • No additional external services are explicitly referenced in the provided code snippet.

Troubleshooting

  • Common issues:
    • Invalid or missing environment identifier (Id property) will prevent the node from querying metrics.
    • Network connectivity problems to the Kubernetes API server can cause request failures.
    • Insufficient permissions for the API token may result in authorization errors.
  • Error messages:
    • Authentication errors indicate invalid or expired credentials; verify and update the API key.
    • Timeout or connection refused errors suggest network or endpoint configuration issues.
    • Parsing errors might occur if the metrics API response format changes unexpectedly.

Links and References

Discussion