Kubernetes icon

Kubernetes

Interact with Kubernetes

StatefulSets → Exec

AI-generated

Overview

This node interacts with Kubernetes StatefulSets to execute commands inside containers of StatefulSet pods. It is useful for running shell commands or scripts directly within a container for debugging, maintenance, or automation purposes. For example, you can execute a diagnostic command inside a container of a StatefulSet to check its status or configuration without needing to SSH into the node.

Use Case Examples

  1. Executing a shell command inside a container of a StatefulSet to retrieve logs or status information.
  2. Running a script inside a StatefulSet container to perform maintenance tasks.

Properties

Name Meaning
Image The container image to use (relevant for some operations like run, restart, exec, patch).
Namespace The Kubernetes namespace where the StatefulSet resides.
Resource Name The name of the StatefulSet resource to target.
Container Name The name of the container inside the StatefulSet 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 that the Kubernetes credentials provided have sufficient permissions to execute commands inside StatefulSet pods.
  • Verify that the resource name and namespace are correct and that the StatefulSet exists in the cluster.
  • The 'command' property must be a valid JSON array; otherwise, the node will throw an error.
  • If the container name is incorrect or the container does not exist in the pod, the exec operation will fail.

Links

Discussion