Actions40
- Node Actions
- Namespace Actions
- Deployment Actions
- Service Actions
- Pod Actions
- StatefulSet Actions
- ConfigMap Actions
- Secret Actions
- Job Actions
- CronJob Actions
Overview
This node integrates with Rancher and Kubernetes APIs to manage various Kubernetes resources programmatically. Specifically, for the Service - Create operation, it allows users to create a new Kubernetes Service within a specified cluster, project, and namespace. This is useful for exposing applications running in pods to internal or external network traffic.
Common scenarios include:
- Exposing a set of pods as a network service inside the cluster (ClusterIP).
- Making services accessible outside the cluster via NodePort or LoadBalancer.
- Automating infrastructure deployment pipelines where services need to be created dynamically.
Example: Creating a LoadBalancer service to expose a web application running on port 80 to external clients.
Properties
| Name | Meaning |
|---|---|
| Name | The name of the Service resource to create. |
| Cluster Name or ID | Select or specify the target Kubernetes cluster where the service will be created. |
| Project Name or ID | Select or specify the project within the cluster. |
| Namespace Name or ID | Select or specify the namespace within the project where the service will reside. |
| Service Type | Type of the service to create. Options: ClusterIP, NodePort, LoadBalancer. |
| Service Port | The port number on which the service will be exposed. |
| Labels | Key-value pairs to label the service for identification and selection purposes. |
| Annotations | Key-value pairs to annotate the service with metadata for additional information or configuration. |
Output
The node outputs an array of JSON objects representing the response from the Rancher/Kubernetes API after creating the service. Each output item contains the full details of the created service resource, including metadata, spec, and status fields as returned by the API.
If binary data were involved (not applicable here), it would be summarized accordingly, but this operation deals only with JSON data.
Dependencies
- Requires a valid Rancher/Kubernetes API authentication token configured in n8n credentials.
- Needs access to the specified Kubernetes cluster, project, and namespace.
- Relies on the Rancher/Kubernetes API endpoints to perform service creation.
Troubleshooting
- Missing or invalid cluster/project/namespace: Ensure that the selected cluster, project, and namespace exist and are accessible with the provided credentials.
- Insufficient permissions: The API token must have rights to create services in the target namespace.
- Invalid service parameters: For example, specifying an unsupported service type or invalid port number may cause errors.
- Network issues: Connectivity problems between n8n and the Kubernetes API server can cause timeouts or failures.
Common error messages might include:
- Unauthorized or forbidden errors indicating credential or RBAC issues.
- Resource already exists if a service with the same name exists.
- Validation errors for incorrect input values.
Resolving these typically involves verifying credentials, permissions, and input correctness.
Links and References
- Kubernetes Services Documentation
- Rancher API Reference
- n8n Expressions Documentation (for dynamic parameter values)