Portainer icon

Portainer

Interact with Portainer via API

Actions190

Kubernetes → Get Kubernetes Metrics For Node

AI-generated

Overview

This node operation retrieves Kubernetes metrics specifically for a given node within a Kubernetes environment. It is useful for monitoring and analyzing the performance or status of individual nodes in a Kubernetes cluster. Typical use cases include gathering CPU, memory, or other resource usage statistics to help with capacity planning, troubleshooting, or alerting.

For example, you might use this node to fetch real-time metrics of a particular node to check if it is under heavy load or to verify that resource limits are not being exceeded.

Properties

Name Meaning
Id Environment identifier: a numeric ID representing the Kubernetes environment to query.
Name Node identifier: the name of the specific Kubernetes node for which metrics are requested.

Output

The output will contain JSON data representing the metrics of the specified Kubernetes node. This typically includes various performance indicators such as CPU usage, memory consumption, network statistics, and possibly disk I/O metrics depending on the Kubernetes metrics API response.

If the node supports binary data output (not evident from the provided code), it would likely be related to raw metric data or logs, but no explicit binary output handling is shown here.

Dependencies

  • Requires access to a Kubernetes environment with metrics enabled.
  • Needs an API key or authentication token configured in n8n credentials to connect securely to the Kubernetes API or metrics endpoint.
  • The node depends on an external OpenAPI specification (openapi.json) and uses a properties builder utility to define its interface.
  • The base URL and authentication details must be set up correctly in the node's credentials configuration.

Troubleshooting

  • Common issues:
    • Incorrect environment ID or node name may result in no data or errors.
    • Lack of proper permissions or missing metrics server in the Kubernetes cluster can cause failures.
    • Network connectivity problems between n8n and the Kubernetes API endpoint.
  • Error messages:
    • Authentication errors indicate invalid or missing API credentials.
    • "Node not found" or similar errors suggest the specified node name does not exist in the targeted environment.
    • Timeout or connection refused errors point to network or endpoint availability issues.
  • Resolutions:
    • Verify the environment ID and node name inputs.
    • Ensure the Kubernetes metrics server is installed and accessible.
    • Confirm API credentials and network settings are correct.

Links and References

Discussion