Actions90
- Jobs Actions
- Namespaces Actions
- Pods Actions
- Services Actions
- Deployments Actions
- ReplicaSets Actions
- StatefulSets Actions
- DaemonSets Actions
- CronJobs Actions
Overview
This node allows interaction with Kubernetes clusters by performing various operations on Kubernetes resources. Specifically, the Scale operation lets users adjust the number of replicas for scalable resources such as Deployments or ReplicaSets within a specified namespace.
Common scenarios include:
- Automatically scaling up or down workloads based on demand.
- Managing resource availability during deployments or maintenance.
- Integrating Kubernetes scaling into automated workflows for DevOps or CI/CD pipelines.
For example, you could use this node to scale a Deployment named "web-app" in the "default" namespace from 3 replicas to 5 replicas as part of an automated workflow triggered by increased traffic.
Properties
| Name | Meaning |
|---|---|
| Namespace | The Kubernetes namespace where the target resource resides. Defaults to "default". |
| Resource Name | The name of the specific Kubernetes resource (e.g., deployment, pod) to operate on. |
Note: Although the bundled code supports many operations and properties, for the Scale operation these two are essential inputs.
Output
The node outputs JSON data representing the result of the scale operation. This typically includes the updated state of the scaled resource, such as its new replica count and metadata.
If the operation involves other commands (like running pods), the output may also contain command execution results (stdout). However, for scaling, the output mainly reflects the resource's updated status.
No binary data output is indicated for the Scale operation.
Dependencies
- Requires valid Kubernetes API credentials configured in n8n to authenticate and authorize requests.
- Depends on a Kubernetes client utility (
K8SClient) internally to communicate with the Kubernetes API. - The node expects the Kubernetes cluster to be accessible from the environment where n8n runs.
Troubleshooting
- Missing Credentials Error: If no Kubernetes credentials are provided or they are invalid, the node throws an error indicating missing credentials. Ensure that a proper API key or token credential is configured.
- Invalid Resource Name: Providing an incorrect or non-existent resource name will cause the Kubernetes API to return errors. Verify the resource name exists in the specified namespace.
- Namespace Issues: If the namespace does not exist or is misspelled, the operation will fail. Confirm the namespace is correct.
- Unsupported Resource for Scaling: Not all Kubernetes resources support scaling. Attempting to scale unsupported resources will result in errors. Use resources like Deployments, ReplicaSets, or StatefulSets.
- API Permission Denied: Insufficient permissions for the Kubernetes user or service account can cause authorization errors. Check RBAC settings.