Actions40
- Node Actions
- Namespace Actions
- Deployment Actions
- Service Actions
- Pod Actions
- StatefulSet Actions
- ConfigMap Actions
- Secret Actions
- Job Actions
- CronJob Actions
Overview
This node enables interaction with Rancher/Kubernetes APIs to manage Kubernetes resources programmatically within n8n workflows. Specifically, for the StatefulSet Create operation, it allows users to create a new StatefulSet resource in a specified Kubernetes namespace. This is useful for deploying stateful applications that require stable network identities and persistent storage, such as databases or clustered services.
Typical use cases include:
- Automating deployment of stateful applications with specific container images.
- Managing replicas and environment variables for stateful workloads.
- Integrating Kubernetes StatefulSet creation into CI/CD pipelines or infrastructure automation workflows.
Properties
| Name | Meaning |
|---|---|
| Name | Name of the StatefulSet resource to create. |
| Image | Docker image to use for the StatefulSet's container(s). |
| Replicas | Number of pod replicas to run in the StatefulSet (default is 1). |
| Container Port | Port number to expose on the container. |
| Environment Variables | List of environment variables to set inside the container(s). Each variable has a name and value. |
| Cluster Name or ID | Select the Kubernetes cluster where the StatefulSet will be created. |
| Project Name or ID | Select the project within the cluster context. |
| Namespace Name or ID | Select the Kubernetes namespace where the StatefulSet will be deployed. |
| Labels | Key-value pairs to label the StatefulSet resource for identification and selection. |
| Annotations | Key-value pairs to annotate the StatefulSet resource with metadata. |
Output
The node outputs JSON data representing the response from the Kubernetes API after creating the StatefulSet. This typically includes details about the created StatefulSet resource such as its metadata (name, labels, annotations), spec (replicas, container specs), status, and other relevant information returned by the API.
No binary data output is produced by this operation.
Dependencies
- Requires access to a Rancher or Kubernetes API endpoint.
- Needs an API authentication token or API key credential configured in n8n to authenticate requests.
- The user must have appropriate permissions to create StatefulSets in the target cluster, project, and namespace.
- The node depends on internal methods to load available clusters, projects, and namespaces dynamically.
Troubleshooting
- Authentication errors: Ensure the API key or token credential is valid and has sufficient permissions.
- Resource conflicts: If a StatefulSet with the same name already exists, the API may return an error. Use unique names or delete existing resources before creating new ones.
- Invalid parameters: Verify that required fields like
Name,Image,Cluster,Project, andNamespaceare correctly set. - Network issues: Confirm connectivity to the Kubernetes API server and that firewall rules allow communication.
- API version mismatches: Ensure the Kubernetes cluster supports the StatefulSet API version used by the node.
Common error messages usually come directly from the Kubernetes API and indicate issues such as unauthorized access, invalid resource definitions, or quota limits.
Links and References
- Kubernetes StatefulSet Documentation
- Rancher API Documentation
- n8n Expressions Documentation (for dynamic parameter values)