Kubernetes icon

Kubernetes

Interact with Kubernetes

Overview

This node interacts with Kubernetes clusters, specifically supporting operations on various Kubernetes resources including CronJobs. The 'exec' operation allows executing commands inside a container of a Kubernetes pod. This is useful for running diagnostic commands, scripts, or any command-line operations inside the pod environment without needing direct access to the Kubernetes cluster outside the node. For example, you can execute a shell command inside a pod to check logs or system status.

Use Case Examples

  1. Executing a shell command inside a pod of a CronJob to retrieve runtime information.
  2. Running a diagnostic script inside a pod launched by a CronJob to troubleshoot issues.

Properties

Name Meaning
Image The container image to use when running or executing commands inside a pod.
Namespace The Kubernetes namespace where the resource (e.g., CronJob) is located.
Resource Name The name of the specific Kubernetes resource (e.g., the CronJob name) to target for the operation.

Output

JSON

  • stdout - The standard output resulting from executing the command inside the Kubernetes pod.

Dependencies

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

Troubleshooting

  • If no credentials are provided or returned, the node throws an error 'No credentials got returned!'. Ensure Kubernetes API credentials are correctly configured.
  • If the 'command' parameter is not a valid JSON array, the node throws 'Command must be an array!'. Ensure the command input is a JSON array of strings representing the command and its arguments.

Discussion