Actions90
- Jobs Actions
- Namespaces Actions
- Pods Actions
- Services Actions
- Deployments Actions
- ReplicaSets Actions
- StatefulSets Actions
- DaemonSets Actions
- CronJobs Actions
Overview
This node interacts with Kubernetes clusters, allowing users to perform various operations on Kubernetes resources. Specifically for the Deployments resource and the Logs operation, it retrieves logs from deployment-related pods within a specified namespace.
Common scenarios include:
- Debugging deployments by fetching their logs.
- Monitoring application behavior directly from n8n workflows.
- Automating log retrieval for deployments as part of CI/CD pipelines or alerting systems.
For example, you can use this node to fetch logs from a deployment named "my-app" in the "default" namespace to analyze recent events or errors.
Properties
| Name | Meaning |
|---|---|
| Namespace | The Kubernetes namespace where the deployment resides. Defaults to "default". |
| Resource Name | The name of the specific deployment resource to target for retrieving logs. |
Output
The node outputs JSON data containing the logs retrieved from the specified deployment's pods. The exact structure depends on the Kubernetes API response but generally includes log lines or aggregated log content under the json output field.
If binary data were involved (e.g., raw log files), it would be indicated here, but this node returns textual log data in JSON format.
Dependencies
- Requires access to a Kubernetes cluster with appropriate permissions.
- Needs an API authentication token or credentials configured in n8n to connect securely to the Kubernetes API.
- The node uses a Kubernetes client utility internally to communicate with the cluster.
Troubleshooting
No credentials got returned!
This error indicates missing or misconfigured Kubernetes credentials in n8n. Ensure that the API key or authentication token is correctly set up.Resource not found or empty logs
If the specified deployment or namespace does not exist, or if there are no logs available, the node may return empty results. Verify the resource name and namespace spelling.Command must be an array!
Although not directly related to Logs operation, this error appears when the "command" input is malformed for other operations like "run". Make sure commands are provided as valid JSON arrays.Network or permission issues
Failure to connect to the Kubernetes API or insufficient permissions will cause errors. Confirm network connectivity and RBAC permissions for the used credentials.