Kubernetes icon

Kubernetes

Interact with Kubernetes

Overview

This node interacts with a Kubernetes cluster to perform various operations on Kubernetes resources. Specifically, for the 'Logs' operation, it retrieves logs from a specified Kubernetes resource within a given namespace. This node is useful for monitoring and debugging applications running in Kubernetes by accessing their logs directly within an automation workflow.

Use Case Examples

  1. Fetching logs from a specific pod in the 'default' namespace to monitor application behavior.
  2. Retrieving logs from a deployment to diagnose issues during a CI/CD pipeline.

Properties

Name Meaning
Namespace The Kubernetes namespace where the target resource resides. Defaults to 'default' if not specified.
Resource Name The name of the specific Kubernetes resource (e.g., pod, deployment) from which to retrieve logs.

Output

JSON

  • logs - The logs retrieved from the specified Kubernetes resource.

Dependencies

  • Requires Kubernetes API credentials to authenticate and interact with the Kubernetes cluster.

Troubleshooting

  • Ensure that the Kubernetes credentials provided have sufficient permissions to access the specified namespace and resource.
  • Verify that the resource name and namespace are correct; otherwise, the node may fail to retrieve logs or return empty results.
  • Common error: 'No credentials got returned!' indicates missing or misconfigured Kubernetes credentials; ensure credentials are properly set up in n8n.

Links

  • Kubernetes Namespaces - Documentation on Kubernetes namespaces, useful for understanding the 'Namespace' property.
  • Kubernetes Pods - Documentation on Kubernetes pods, relevant for understanding resources from which logs can be retrieved.

Discussion