Actions54
- Namespace Actions
- Deployment Actions
- Service Actions
- Pod Actions
- StatefulSet Actions
- ConfigMap Actions
- Secret Actions
- Job Actions
- CronJob Actions
- Node Actions
- Workload Actions
Overview
This node allows users to interact with the Rancher/Kubernetes API, specifically enabling management of Kubernetes resources such as StatefulSets. For the StatefulSet Create operation, it facilitates creating a new StatefulSet resource in a specified Kubernetes cluster. This is useful for deploying stateful applications that require stable network identities and persistent storage, such as databases or distributed systems.
Typical use cases include:
- Automating deployment of stateful applications in Kubernetes clusters.
- Managing replicas and container configurations programmatically.
- Setting environment variables, labels, and annotations on StatefulSets during creation.
Example: Creating a StatefulSet running a database image with 3 replicas, exposing port 80, and setting custom environment variables.
Properties
Name | Meaning |
---|---|
Name | The name of the StatefulSet resource to create. |
Image | Docker image to use for the containers in the StatefulSet. |
Replicas | Number of pod replicas to run in the StatefulSet (default is 1). |
Container Port | Port number to expose on each container in the StatefulSet (default is 80). |
Environment Variables | List of environment variables to set inside the containers. Each variable has a Name and a Value. |
Cluster Name or ID | Select the target Kubernetes cluster by name or ID where the StatefulSet will be created. |
Project Name or ID | (Optional) Select the project within the cluster. |
Namespace Name or ID | (Optional) Select the namespace within the project where the StatefulSet will be created. |
Labels | Key-value pairs to label the StatefulSet resource for identification and selection purposes. |
Annotations | Key-value pairs to annotate the StatefulSet resource with additional metadata. |
Output
The node outputs JSON data representing the response from the Rancher/Kubernetes API after creating the StatefulSet. This typically includes details about the created StatefulSet resource such as its metadata, status, spec, and other Kubernetes-specific information.
No binary data output is produced by this operation.
Dependencies
- Requires access to a Rancher or Kubernetes API endpoint.
- Requires 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 selected cluster, project, and namespace.
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 in the namespace, creation will fail. Use unique names or delete existing resources first.
- Invalid parameters: Verify that required fields like
Name
,Image
, andCluster
are correctly set. - Namespace/project issues: Make sure the specified namespace and project exist in the cluster.
- API connectivity: Confirm network connectivity to the Rancher/Kubernetes API endpoint.
Common error messages may include unauthorized access, resource already exists, or invalid input schema. Resolving these usually involves checking credentials, resource names, and API endpoint configuration.
Links and References
- Kubernetes StatefulSet Documentation
- Rancher API Reference
- n8n Expressions Documentation (for dynamic parameter values)