> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flexagon.com/llms.txt
> Use this file to discover all available pages before exploring further.

# executeKubectlCommand (Kubernetes)

> @Since 11.2.0.0 Runs free form kubectl commands after selecting the Kubernetes context. Use this operation when you need kubectl behavior that is not

@Since 11.2.0.0

Runs free-form `kubectl` commands after selecting the Kubernetes context. Use this operation when you need kubectl behavior that is not covered by the dedicated apply, delete, label, scale, run, or exec operations (for example checking rollout status or retrieving a service external IP).

Before running your snippet, the plugin executes `kubectl config use-context` with the Context input. Each non-empty line in Kubectl Commands is executed as a separate command on the selected endpoint. When Stop on Error is checked, execution stops if a command fails; when unchecked (default), later lines continue and only the last command’s exit code is checked.

If a line omits the `kubectl` CLI, the plugin prefixes it. Lines that already start with `kubectl` or `kubectl.exe` are executed as typed. Lines that start with `/`, `.`, or a Windows drive path (for example `C:\...`) are executed as typed so you can call an explicit kubectl path.

# Target Properties

<table><tbody><tr><th>**Property Name**</th><th>**Property Code**</th><th>**Required**</th><th>**Description**</th></tr><tr><td>Kubernetes Home</td><td>`FDKN_KUBERNETES_HOME`</td><td>No</td><td>Kubernetes Home Directory.</td></tr><tr><td>Kubeconfig File Path</td><td>`FDKN_KUBE_CONFIG_PATH`</td><td>No</td><td>Absolute path of kubeconfig file</td></tr><tr><td>Cloud Account</td><td>`FDCLOUD_ACCOUNT_CODE`</td><td>No</td><td>Select Cloud Account</td></tr><tr><td>Directory where Cloud CLI is installed</td><td>`FDCLOUD_CLI_PATH`</td><td>No</td><td>e.g. /usr/local/bin or /u01/azure/bin</td></tr></tbody></table>

# Inputs

<table><tbody><tr><th>**Input Name**</th><th>**Input Code**</th><th>**Required**</th><th>**Description**</th></tr><tr><td>Context</td><td>`FDKN_INP_CONTEXT`</td><td>Yes</td><td>Context (cluster, namespace, and user). If unsure, running `kubectl config current-context` shows the current context.</td></tr><tr><td>Kubectl Commands</td><td>`FDKN_INP_KUBECTL_COMMANDS`</td><td>Yes</td><td>One or more kubectl commands to run (one per line). Context is set automatically before these commands. `kubectl` is prefixed when omitted. Example: `get pods -n default`.</td></tr><tr><td>Stop on Error</td><td>`FDKN_INP_STOP_ON_ERROR`</td><td>No</td><td>@Since 11.2.0.0 Flag that indicates whether kubectl commands should stop on an error or continue. If checked, execution halts when a command fails. Otherwise (default false), only the last command’s return code is checked.</td></tr></tbody></table>

# Artifacts

This operation does not consume or produce artifacts.

# Endpoint Selection

This operation delegates the selection to the workflow developer to determine.

# Endpoint Execution

This operation delegates the execution to the workflow developer to determine.

# Example

Full command in Kubectl Commands:

```
kubectl get pods -n default
```

Args-only snippet (the plugin prefixes `kubectl`):

```
get pods -n default
```

Multiple commands, one per line:

```
kubectl rollout status deployment/my-app -n default
kubectl get svc my-app -n default -o jsonpath='{.status.loadBalancer.ingress[0].ip}'
```
