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 clusters by performing various operations on Kubernetes resources such as pods, services, deployments, and more. It is useful for automating cluster management tasks directly within n8n workflows.
For the Logs operation specifically, the node retrieves logs from a specified Kubernetes resource (e.g., a pod) within a given namespace. This is beneficial for monitoring application behavior, debugging issues, or auditing events in your Kubernetes environment.
Practical examples:
- Fetching logs from a specific pod to analyze application errors.
- Automating log retrieval for scheduled audits or alerts.
- Integrating Kubernetes logs into centralized logging or monitoring systems via n8n.
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., pod name) from which to retrieve logs. |
Note: These properties are used when the operation is set to "logs" and the resource is specified.
Output
The node outputs JSON data representing the logs retrieved from the specified Kubernetes resource. The exact structure depends on the Kubernetes API response but generally includes log lines or aggregated log content.
If the node supports binary data output (not explicitly shown here), it would typically represent raw log files or streamed log content.
Dependencies
- Requires valid Kubernetes API credentials configured in n8n to authenticate and communicate with the Kubernetes cluster.
- Relies on an internal Kubernetes client utility (
K8SClient) to perform API calls. - The node expects the Kubernetes cluster to be accessible from the n8n environment.
Troubleshooting
No credentials got returned!
This error indicates missing or misconfigured Kubernetes API credentials. Ensure that the required API authentication token or key is properly set up in n8n credentials.Invalid resource name or namespace:
If the specified resource or namespace does not exist, the Kubernetes API will return an error. Verify the names and ensure the resource is available.Network connectivity issues:
Failure to connect to the Kubernetes API endpoint may cause timeouts or connection errors. Confirm network access and correct API endpoint configuration.Command must be an array! (relevant for other operations like "run")
When providing commands, ensure they are formatted as a JSON array.