Skip to content

RPL-77: GKE, AKS, EKS node sources and node steps plugins #1593

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/.vuepress/sidebar-menus/user-guide.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,14 @@ export default [{
children: [
'/manual/projects/resource-model-sources/',
'/manual/projects/resource-model-sources/aws',
'/manual/projects/resource-model-sources/aws-eks',
'/manual/projects/resource-model-sources/azure',
'/manual/projects/resource-model-sources/azure-aks',
'/manual/projects/resource-model-sources/datadog',
{text:'Docker', link:'/manual/projects/resource-model-sources/docker'},
'/manual/projects/resource-model-sources/ecs-fargate',
'/manual/projects/resource-model-sources/gcp',
'/manual/projects/resource-model-sources/gcp-gke',
'/manual/projects/resource-model-sources/kubernetes',
'/manual/projects/resource-model-sources/builtin',
'/manual/projects/resource-model-sources/oracle',
Expand Down Expand Up @@ -104,6 +107,14 @@ export default [{
{text: 'Kubernetes Pod', link: '/manual/jobs/job-plugins/node-steps/kubernetes-pod-plugins', icon: '/assets/img/kubernetes-icon.png'},
{text: 'Kubernetes Service', link: '/manual/jobs/job-plugins/node-steps/kubernetes-service-plugins', icon: '/assets/img/kubernetes-icon.png'},
{text: 'Kubernetes StatefulSet', link: '/manual/jobs/job-plugins/node-steps/kubernetes-statefulset-plugins', icon: '/assets/img/kubernetes-icon.png'},
{text: 'Kubernetes Cluster Create Object', link: '/manual/jobs/job-plugins/node-steps/kubernetes-create-object', icon: '/assets/img/kubernetes-icon.png'},
{text: 'Kubernetes Cluster Delete Object', link: '/manual/jobs/job-plugins/node-steps/kubernetes-delete-object', icon: '/assets/img/kubernetes-icon.png'},
{text: 'Kubernetes Cluster Describe Object', link: '/manual/jobs/job-plugins/node-steps/kubernetes-describe-object', icon: '/assets/img/kubernetes-icon.png'},
{text: 'Kubernetes Cluster List Objects', link: '/manual/jobs/job-plugins/node-steps/kubernetes-list-objects', icon: '/assets/img/kubernetes-icon.png'},
{text: 'Kubernetes Cluster Object Logs', link: '/manual/jobs/job-plugins/node-steps/kubernetes-object-logs', icon: '/assets/img/kubernetes-icon.png'},
{text: 'Kubernetes Cluster Run Command', link: '/manual/jobs/job-plugins/node-steps/kubernetes-run-command', icon: '/assets/img/kubernetes-icon.png'},
{text: 'Kubernetes Cluster Run Script', link: '/manual/jobs/job-plugins/node-steps/kubernetes-run-script', icon: '/assets/img/kubernetes-icon.png'},
{text: 'Kubernetes Cluster Update Object', link: '/manual/jobs/job-plugins/node-steps/kubernetes-update-object', icon: '/assets/img/kubernetes-icon.png'},
{text: 'Jira', link: '/manual/jobs/job-plugins/node-steps/jira', icon: '/assets/img/jira-icon.svg'},
{text: 'Local Command Step', link: '/manual/jobs/job-plugins/node-steps/builtin.md#local-command-step', icon: '/assets/img/command-icon.png'},
{text: 'Loop Script', link: '/manual/jobs/job-plugins/node-steps/loop-plugins',icon: '/assets/img/pd-icon.png'},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Kubernetes Clusters - Create Object
:::enterprise
:::

## Overview

This plugin creates an object of a selected kind within a Kubernetes cluster. It is designed to work in conjunction with the AWS EKS, GCP GKE, and Azure AKS [Resource Model Source plugins](/manual/projects/resource-model-sources/).

## Configuration

### Required Fields

* **YAML Definition**: The YAML definition of the object to be created.
* **Namespace**: The namespace where the object will be created. Default is `default`.

### Optional Fields

* **Object Type**: Select the type of object to create (e.g., Pods, ConfigMaps, Deployments). Default is "Pods".
* **Output Format**: Choose the format for the output (JSON or YAML). Default is JSON.

## Usage

1. Select the desired object type from the dropdown menu.
2. Provide the YAML definition for the object you want to create.
3. Specify the namespace where the object should be created.
4. Choose the preferred output format.

## Authentication

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:

1. When disabled, the plugin uses the cloud provider credentials set in the resource model to retrieve the
kube-config for the targeted cluster.

2. When enabled, the [Enterprise Runner](/administration/runner/) must be placed in the cluster and uses its pod's K8s service account for authentication.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Kubernetes Clusters - Delete Object
:::enterprise
:::

## Overview

This plugin creates an object of a selected kind within a Kubernetes cluster. It is designed to work in conjunction with the AWS EKS, GCP GKE, and Azure AKS [Resource Model Source plugins](/manual/projects/resource-model-sources/).


## Configuration

### Required Fields

* **Name**: The name of the object to be deleted, such as Pod name or Deployment name.
* **Namespace**: The namespace where the object resides. Default is `default`.

### Optional Fields

* **Object Type**: Select the type of object to delete (e.g., Pods, ConfigMaps, Deployments). Default is "Pods".
* **Output Format**: Choose the format for the output (JSON or YAML). Default is JSON.

## Usage

1. Select the desired object type from the dropdown menu.
2. Provide the name of the object you want to delete.
3. Specify the namespace where the object is located.
4. Choose the preferred output format.

## Authentication

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:

1. When disabled, the plugin uses the cloud provider credentials set in the resource model to retrieve the
kube-config for the targeted cluster.

2. When enabled, the [Enterprise Runner](/administration/runner/) must be placed in the cluster and uses its pod's K8s service account for authentication.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Kubernetes Clusters - Describe Object
:::enterprise
:::

## Overview

This plugin describes an object of a selected kind within a Kubernetes cluster. It is designed to work in conjunction with the AWS EKS, GCP GKE, and Azure AKS [Resource Model Source plugins](/manual/projects/resource-model-sources/).
## Configuration

### Required Fields

* **Name**: The name of the object to be described, such as Pod name or Deployment name.
* **Namespace**: The namespace where the object resides. Default is `default`.

### Optional Fields

* **Object Type**: Select the type of object to describe (e.g., Pods, ConfigMaps, Deployments). Default is "Pods".
* **Output Format**: Choose the format for the output (JSON or YAML). Default is JSON.

## Usage

1. Select the desired object type from the dropdown menu.
2. Provide the name of the object you want to describe.
3. Specify the namespace where the object is located.
4. Choose the preferred output format.

## Authentication

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:

1. When disabled, the plugin uses the cloud provider credentials set in the resource model to retrieve the
kube-config for the targeted cluster.

2. When enabled, the [Enterprise Runner](/administration/runner/) must be placed in the cluster and uses its pod's K8s service account for authentication.
42 changes: 42 additions & 0 deletions docs/manual/jobs/job-plugins/node-steps/kubernetes-list-objects.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Kubernetes Clusters - List Objects
:::enterprise
:::

## Overview

This plugin creates an object of a selected kind within a Kubernetes cluster. It is designed to work in conjunction with the AWS EKS, GCP GKE, and Azure AKS [Resource Model Source plugins](/manual/projects/resource-model-sources/).

## Configuration

### Required Fields

* **Namespace**: The namespace to list objects from. Default is `default`.

### Optional Fields

* **Object Type**: Select the type of object to list (e.g., Pods, ConfigMaps, Deployments). Default is "Pods".
* **All Namespaces**: If selected, retrieve objects from across all namespaces. The 'Namespace' field will be ignored.
* **Label Selector**: Filter objects based on labels. Supports equality-based and set-based selectors.
* **Field Selector**: Filter objects based on fields. Supports equality-based and set-based selectors.
* **Output Format**: Choose the format for the output (Simple List, JSON, or YAML). Default is "Simple List".

## Usage

1. Select the desired object type from the dropdown menu.
2. Specify the namespace or choose to list from all namespaces.
3. Optionally, add label or field selectors to filter the results.
4. Choose the preferred output format.

## Authentication

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:

1. When disabled, the plugin uses the cloud provider credentials set in the resource model to retrieve the
kube-config for the targeted cluster.

2. When enabled, the [Enterprise Runner](/administration/runner/) must be placed in the cluster and uses its pod's K8s service account for authentication.

## Notes

- For detailed information on label selectors, refer to the [Kubernetes documentation on label selectors](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors).
- For detailed information on field selectors, refer to the [Kubernetes documentation on field selectors](https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors/).
41 changes: 41 additions & 0 deletions docs/manual/jobs/job-plugins/node-steps/kubernetes-object-logs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Kubernetes Clusters - Object Logs
:::enterprise
:::

## Overview

This plugin allows you to view the logs of an object within a Kubernetes cluster. It is designed to work in conjunction with the AWS EKS, GCP GKE, and Azure AKS [Resource Model Source plugins](/manual/projects/resource-model-sources/)

## Configuration

### Required Fields

* **Name**: The name of the object to view logs from, such as Pod name or Deployment name.
* **Namespace**: The namespace where the object resides. Default is `default`.

### Optional Fields

* **Container**: Specify a particular container to view logs from within the object.
* **Number of Log Lines**: The number of log lines to retrieve. Default is 50.
* **Time-span (seconds)**: A relative time in seconds before the current time from which to show logs.
* **Follow Logs**: If selected, the plugin will follow the log output. Note that the Job may continue to run until manually stopped.

## Usage

1. Provide the name of the object you want to view logs from.
2. Specify the namespace where the object is located.
3. Optionally, specify a particular container, number of log lines, time-span, or choose to follow logs.

## Authentication

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:

1. When disabled, the plugin uses the cloud provider credentials set in the resource model to retrieve the
kube-config for the targeted cluster.

2. When enabled, the [Enterprise Runner](/administration/runner/) must be placed in the cluster and uses its pod's K8s service account for authentication.

## Notes

- When using the "Follow Logs" option, be aware that the Job will continue running until it's manually stopped.
- The Time-span option allows you to view logs from a specific point in time, which can be useful for troubleshooting recent issues.
41 changes: 41 additions & 0 deletions docs/manual/jobs/job-plugins/node-steps/kubernetes-run-command.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Kubernetes Clusters - Run Command
:::enterprise
:::

## Overview

This plugin allows you to execute a command in a pod within a Kubernetes cluster. It is designed to work in conjunction with the AWS EKS, GCP GKE, and Azure AKS [Resource Model Source plugins](/manual/projects/resource-model-sources/).
## Configuration

### Required Fields

* **Pod Name**: The name of the pod to execute the command in.
* **Namespace**: The namespace where the pod resides. Default is `default`.
* **Command**: The command to execute in the pod.

### Optional Fields

* **Container**: Specify a particular container within the pod to execute the command in.
* **Shell**: Specific shell to use for executing the command in the container. Default is `/bin/sh`.

## Usage

1. Provide the name of the pod you want to execute the command in.
2. Specify the namespace where the pod is located.
3. Enter the command you want to execute.
4. Optionally, specify a particular container and/or shell to use.

## Authentication

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:

1. When disabled, the plugin uses the cloud provider credentials set in the resource model to retrieve the
kube-config for the targeted cluster.

2. When enabled, the [Enterprise Runner](/administration/runner/) must be placed in the cluster and uses its pod's K8s service account for authentication.

## Notes

- Make sure the command you're executing is available in the specified container.
- If no specific container is specified, the command will be executed in the first container of the pod.
- The shell option allows you to choose a different shell if the default `/bin/sh` is not available or if you need to use a different shell for specific commands.
44 changes: 44 additions & 0 deletions docs/manual/jobs/job-plugins/node-steps/kubernetes-run-script.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Kubernetes Clusters - Run Script
:::enterprise
:::

## Overview

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/).

## Configuration

### Required Fields

* **Script**: The script to execute in the container.
* **Invocation Command**: The command to execute the script in the container. Default is `sh -c`.
* **Container Image**: The container image to use for script execution. Default is `amazon/aws-cli`.
* **Namespace**: The namespace where the Kubernetes Job will be deployed. Default is `default`.

### Optional Fields

* **Environment Variables**: Environment variables to pass to the container (YAML syntax).
* **Image Pull Policy**: The image pull policy for the container. Options are "Always", "IfNotPresent", or "Never". Default is "Always".

## Usage

1. Enter the script you want to execute.
2. Specify the invocation command (if different from default).
3. Choose the container image to use.
4. Specify the namespace for the Job deployment.
5. Optionally, add environment variables and set the image pull policy.

## Authentication

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:

1. When disabled, the plugin uses the cloud provider credentials set in the resource model to retrieve the
kube-config for the targeted cluster.

2. When enabled, the [Enterprise Runner](/administration/runner/) must be placed in the cluster and uses its pod's K8s service account for authentication.

## Notes

- The Job is automatically deleted after script execution.
- 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.
- 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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Kubernetes Clusters - Update Object
:::enterprise
:::

## Overview

This plugin updates a specified object of a selected kind within a Kubernetes cluster. It is designed to work in conjunction with the AWS EKS, GCP GKE, and Azure AKS [Resource Model Source plugins](/manual/projects/resource-model-sources/).

## Configuration

### Required Fields

* **Object Name**: The name of the object to be updated.
* **YAML Definition**: The YAML definition of the object to be updated.
* **Namespace**: The namespace where the object resides. Default is `default`.

### Optional Fields

* **Object Type**: Select the type of object to update (e.g., Pods, Deployments, Services). Default is "Pods".

## Usage

1. Provide the name of the object you want to update.
2. Select the desired object type from the dropdown menu.
3. Enter the updated YAML definition for the object.
4. Specify the namespace where the object is located.

## Authentication

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:

1. When disabled, the plugin uses the cloud provider credentials set in the resource model to retrieve the
kube-config for the targeted cluster.

2. When enabled, the [Enterprise Runner](/administration/runner/) must be placed in the cluster and uses its pod's K8s service account for authentication.

## Notes

- The plugin uses a field manager named "runbook-automation/apply-patch" for tracking changes.
- Ensure that the YAML definition provided is complete and correct for the object you're updating.
Loading