Actions90
- Jobs Actions
- Namespaces Actions
- Pods Actions
- Services Actions
- Deployments Actions
- ReplicaSets Actions
- StatefulSets Actions
- DaemonSets Actions
- CronJobs Actions
Overview
This node enables interaction with Kubernetes resources, specifically supporting various operations such as running pods, getting resource details, listing resources, deleting, scaling, patching, and more. For the Services resource with the Scale operation, it allows users to adjust the number of replicas or scale parameters of a Kubernetes Service or related scalable resource.
Common scenarios include:
- Automatically scaling services up or down based on workload.
- Managing Kubernetes services programmatically within workflows.
- Integrating Kubernetes scaling actions into CI/CD pipelines or automated infrastructure management.
For example, you might use this node to increase the number of replicas of a deployment when traffic increases or reduce them during off-peak hours.
Properties
| Name | Meaning |
|---|---|
| Namespace | The Kubernetes namespace where the service resides. Defaults to "default". |
| Resource Name | The name of the specific Kubernetes service resource to scale. |
Note: Although the bundled code supports many operations and resources, for the Services resource and Scale operation, these two properties are essential inputs.
Output
The node outputs JSON data representing the result of the scale operation. This typically includes the updated state or status of the scaled resource in Kubernetes, such as the new replica count or confirmation of the scaling action.
If multiple input items are processed, the output is an array of JSON objects corresponding to each item’s result.
No binary data output is indicated by the source code.
Dependencies
- Requires valid Kubernetes API credentials (an API key or token) configured in n8n to authenticate requests.
- Depends on a Kubernetes client utility (
K8SClient) internally to communicate with the Kubernetes cluster. - The node expects the Kubernetes cluster to be accessible from the environment where n8n runs.
Troubleshooting
No credentials got returned!
This error occurs if the node cannot retrieve the required Kubernetes API credentials. Ensure that the credentials are properly set up and linked to the node.Command must be an array!
While not directly related to the Scale operation, this error appears if thecommandproperty (used in other operations like run) is not a valid JSON array. Make sure commands are formatted correctly.Resource not found or invalid namespace
If the specified service name or namespace does not exist, the Kubernetes API will return an error. Verify that the resource name and namespace are correct.Insufficient permissions
The Kubernetes credentials used must have permission to perform scaling operations on the target resource.