Kubernetes icon

Kubernetes

Interact with Kubernetes

Overview

This node allows interaction with Kubernetes resources, specifically supporting operations on various resource types including CronJobs. The Scale operation enables users to adjust the number of replicas for a given Kubernetes resource within a specified namespace.

Common scenarios where this node is beneficial include:

  • Automatically scaling workloads based on external triggers or schedules.
  • Managing resource capacity programmatically without direct access to Kubernetes CLI.
  • Integrating Kubernetes scaling into broader automation workflows.

For example, you could use this node to scale a CronJob up or down depending on workload demands or time of day, helping optimize resource usage and costs.

Properties

Name Meaning
Namespace The Kubernetes namespace where the target resource (CronJob) resides. Defaults to "default".
Resource Name The name of the specific CronJob resource to scale.

These properties are used to identify which CronJob in which namespace should be scaled.

Output

The node outputs JSON data representing the result of the scale operation. This typically includes the updated state or status of the targeted Kubernetes resource after scaling.

The output json field contains an array of objects reflecting the response from the Kubernetes API regarding the scaling action performed.

No binary data output is involved in this operation.

Dependencies

  • Requires valid Kubernetes API credentials configured in n8n to authenticate and authorize requests.
  • Depends on connectivity to the Kubernetes cluster API endpoint.
  • Uses an internal Kubernetes client utility (K8SClient) to perform API calls.

Troubleshooting

  • No credentials got returned!
    This error indicates missing or misconfigured Kubernetes API credentials. Ensure that the node has access to a valid API key or token with sufficient permissions.

  • Resource not found or permission denied
    Verify that the specified namespace and resource name exist and that the credentials have rights to modify them.

  • Invalid input errors
    Make sure the Namespace and Resource Name fields are correctly set and correspond to existing Kubernetes resources.

  • Network or API errors
    Confirm network connectivity to the Kubernetes API server and that the API endpoint is reachable.

Links and References

Discussion