|
4 | 4 |
|
5 | 5 | ## Overview |
6 | 6 |
|
7 | | -This plugin executes a script using a predefined container image within a Kubernetes cluster. It deploys a Kubernetes Job to run the script in a container, then deletes the Job after execution. This plugin is designed to work in conjunction with the AWS EKS, GCP GKE, and Azure AKS [Resource Model Source plugins](/manual/projects/resource-model-sources/). |
| 7 | +This plugin executes a script using a predefined container image within a Kubernetes cluster. It deploys a Kubernetes Job to run the script in a container, then deletes the Job after execution. Since this is a node-step plugin, multiple Kubernetes clusters or namespaces can be targeted within a single Job. |
8 | 8 |
|
9 | 9 | ## Configuration |
10 | 10 |
|
11 | | -### Required Fields |
| 11 | +### Prerequisites |
12 | 12 |
|
13 | | -* **Script**: The script to execute in the container. |
14 | | -* **Invocation Command**: The command to execute the script in the container. Default is `sh -c`. |
15 | | -* **Container Image**: The container image to use for script execution. Default is `amazon/aws-cli`. |
16 | | -* **Namespace**: The namespace where the Kubernetes Job will be deployed. Default is `default`. |
17 | | - |
18 | | -### Optional Fields |
19 | | - |
20 | | -* **Environment Variables**: Environment variables to pass to the container (YAML syntax). |
21 | | -* **Image Pull Policy**: The image pull policy for the container. Options are "Always", "IfNotPresent", or "Never". Default is "Always". |
| 13 | +Before configuring the Kubernetes Run Script plugin, the target clusters must be added to the Runbook Automation instance and the authentication method must be configured. This is done by following the steps outlined in the [Kubernetes Plugins Overview](/manual/plugins/kubernetes-plugins-overview.md). |
22 | 14 |
|
23 | | -## Usage |
| 15 | +### Add Kubernetes Run Script Step |
24 | 16 |
|
25 | | -1. Enter the script you want to execute. |
26 | | -2. Specify the invocation command (if different from default). |
27 | | -3. Choose the container image to use. |
28 | | -4. Specify the namespace for the Job deployment. |
29 | | -5. Optionally, add environment variables and set the image pull policy. |
| 17 | +When building a Job, add the **Kubernetes / Clusters / Run Script** node step: |
30 | 18 |
|
31 | | -## Authentication |
| 19 | +<br> |
32 | 20 |
|
33 | | -Kubernetes Clusters plugins operate on a per-cluster basis and authenticate in one of two ways, as configured in the [Resource Model Plugin](/manual/projects/resource-model-sources/) used to fetch the nodes. This configuration is controlled by the `Use Pod Service Account for Node Steps` option: |
| 21 | +Configure the following fields: |
34 | 22 |
|
35 | | -1. When disabled, the plugin uses the cloud provider credentials set in the resource model to retrieve the |
36 | | - kube-config for the targeted cluster. |
37 | | - |
38 | | -2. When enabled, the [Enterprise Runner](/administration/runner/) must be placed in the cluster and uses its pod's K8s service account for authentication. |
| 23 | +* **Script**: The script to execute in the container. |
| 24 | +* **Invocation Command**: The command to execute the script in the container. Default is `sh -c`. |
| 25 | +* **Container Image**: The container image to use for script execution. Default is `amazon/aws-cli`. |
| 26 | +* **Namespace**: The namespace where the Kubernetes Job will be deployed. Default is `default`. |
| 27 | +* **Environment Variables**: Environment variables to pass to the container (YAML syntax). |
| 28 | +* **Image Pull Policy**: The image pull policy for the container. Options include: |
| 29 | + * `Always` |
| 30 | + * `IfNotPresent` |
| 31 | + * `Never` |
39 | 32 |
|
40 | 33 | ## Notes |
41 | 34 |
|
42 | | -- The Job is automatically deleted after script execution. |
| 35 | +- The pod that was used to execute the script is automatically deleted after script execution. |
43 | 36 | - Environment variables support the 'valueFrom' field for referencing secrets and other sources. See [Kubernetes Docs](https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/) for detailed syntax and examples. |
44 | | -- Predefined container images include options like `amazon/aws-cli`, `bitnami/kubectl`, `mcr.microsoft.com/azure-cli`, `google/cloud-sdk`, and `dtzar/helm-kubectl`, but custom images can also be specified. |
| 37 | +- Predefined container images include options like `amazon/aws-cli`, `bitnami/kubectl`, `mcr.microsoft.com/azure-cli`, `google/cloud-sdk`, and `dtzar/helm-kubectl`, but other images may be used. |
0 commit comments