Kubernetes icon

Kubernetes

Interact with Kubernetes

Overview

This node allows interaction with Kubernetes clusters by performing various operations on Kubernetes resources. Specifically, for the Namespaces resource and the Scale operation, it enables scaling of a namespace-related resource within a specified Kubernetes namespace.

Common scenarios where this node is beneficial include automating Kubernetes cluster management tasks such as scaling deployments or other scalable resources programmatically, integrating Kubernetes control into workflows, or managing namespaces and their associated resources dynamically.

For example, you could use this node to scale the number of replicas in a deployment within a particular namespace based on external triggers or monitoring data, helping maintain application performance and availability.

Properties

Name Meaning
Namespace The Kubernetes namespace in which the target resource resides. Defaults to "default".
Resource Name The name of the specific resource instance to scale within the given namespace.

Output

The node outputs JSON data representing the result of the scale operation on the specified Kubernetes resource. This typically includes status information about the scaled resource, such as the new replica count or confirmation of the scaling action.

If the node supports binary data output (not evident from the provided code), it would represent any binary content returned by the Kubernetes API, but for the Scale operation on Namespaces, the output is JSON-based.

Dependencies

  • Requires valid Kubernetes API credentials configured in n8n to authenticate and interact with the Kubernetes cluster.
  • Depends on an internal Kubernetes client utility (K8SClient) to perform API calls.
  • No additional external services are required beyond access to the Kubernetes API endpoint.

Troubleshooting

  • No credentials got returned!
    This error indicates that the node could not retrieve the necessary Kubernetes API credentials. Ensure that the credentials are properly set up and linked to the node.

  • Command must be an array!
    Although not directly related to the Scale operation, this error can occur if the user attempts to run commands with incorrect formatting. For Scale, ensure input properties are correctly specified.

  • Resource or Namespace not found
    If the specified resource name or namespace does not exist, the Kubernetes API will return an error. Verify that the resource and namespace names are correct and exist in the cluster.

  • Insufficient permissions
    The Kubernetes credentials used must have appropriate permissions to perform scaling operations on the targeted resources.

Links and References

Discussion