Kubernetes icon

Kubernetes

Interact with Kubernetes

Overview

This node interacts with Kubernetes clusters, allowing users to perform various operations such as running pods, deleting resources, executing commands, and patching resources within specified namespaces. It is useful for automating Kubernetes management tasks directly from n8n workflows. For example, users can patch a namespace to update its configuration or run a pod with a specific image and command.

Use Case Examples

  1. Patching a Kubernetes namespace to update its metadata or labels.
  2. Running a pod in a specific namespace with a given container image and command.
  3. Deleting a Kubernetes resource like a pod or namespace.

Properties

Name Meaning
Image The container image to use when running or patching a pod in Kubernetes.
Namespace The Kubernetes namespace where the operation will be performed.
Resource Name The name of the Kubernetes resource to operate on, such as a namespace or pod.

Output

JSON

  • stdout - The standard output from running a pod or executing a command in Kubernetes.

Dependencies

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

Troubleshooting

  • If no credentials are returned, the node will throw an error indicating missing Kubernetes credentials. Ensure credentials are properly configured.
  • If the 'command' parameter is not an array when running a pod, an error is thrown. Make sure the command is provided as a JSON array.
  • Operations may fail if the specified namespace or resource name does not exist or the user lacks permissions.

Discussion