Kubernetes icon

Kubernetes

Interact with Kubernetes

Overview

This node allows interaction with Kubernetes resources, specifically supporting operations on Jobs among other resource types. The Scale operation for Jobs enables users to adjust the number of active job instances (pods) running in a Kubernetes cluster by specifying the desired scale parameters.

Common scenarios where this node is beneficial include:

  • Automatically scaling batch jobs up or down based on workload demands.
  • Managing job concurrency and resource utilization in CI/CD pipelines.
  • Integrating Kubernetes job management into automated workflows without manual kubectl commands.

For example, you could use this node to scale a Job named "data-processing-job" in the "default" namespace to increase its parallelism or completions count dynamically during peak processing times.

Properties

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

Note: The node also requires selecting the Operation as "Scale" and the Resource as "Jobs" to perform the scaling action.

Output

The node outputs JSON data representing the result of the scale operation on the specified Job resource. This typically includes the updated state of the Job after scaling, such as the new number of replicas or completions.

If the operation involves binary data (not typical for scaling Jobs), it would be included in the binary output field, but for scaling, the output is purely JSON.

Dependencies

  • Requires valid Kubernetes API credentials configured in n8n to authenticate and authorize requests.
  • Access to the Kubernetes cluster's API server with permissions to read and modify Job resources.
  • The node depends on an internal Kubernetes client utility (K8SClient) to interact with the cluster.

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 errors
    Verify that the specified namespace and Job resource name exist and that the credentials have rights to scale Jobs in that namespace.

  • Invalid input errors
    Make sure the "Namespace" and "Resource Name" fields are correctly filled. Empty or incorrect values can cause failures.

  • General API errors
    Check network connectivity to the Kubernetes API server and confirm that the cluster is reachable.

Links and References

Discussion