Kubernetes icon

Kubernetes

Interact with Kubernetes

Namespaces → Exec

AI-generated

Overview

This node interacts with Kubernetes clusters to perform various operations on Kubernetes resources. Specifically, the 'Exec' operation allows executing commands inside a container of a specified Kubernetes resource (e.g., a pod) within a namespace. This is useful for running diagnostic commands, debugging, or managing containerized applications directly from the workflow. For example, you can execute shell commands inside a pod's container to inspect logs, check configurations, or run scripts without leaving the n8n environment.

Use Case Examples

  1. Executing a shell command inside a pod's container to check application status.
  2. Running a diagnostic command inside a container to troubleshoot issues.

Properties

Name Meaning
Image The container image to use, relevant for operations like run, restart, exec, and patch.
Namespace The Kubernetes namespace where the resource resides.
Resource Name The name of the Kubernetes resource (e.g., pod) to operate on.
Container Name The name of the container inside the pod where the command will be executed.

Output

JSON

  • stdout - The standard output from the executed command inside the container.

Dependencies

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

Troubleshooting

  • Ensure Kubernetes credentials are correctly configured; missing credentials will cause the node to throw an error.
  • The 'Resource Name' parameter is mandatory for the exec operation; omitting it will result in an error.
  • The 'command' parameter must be a valid JSON array; otherwise, the node will throw an error indicating the command must be an array.

Discussion