Kubernetes Plugins
Kubernetes Plugins
Overview
Runbook Automation integrates with Kubernetes through a variety of plugins. By integrating Runbook Automation with Kubernetes, users can automate and provide self-service interfaces for operations in their Kubernetes Clusters. These integrations allow operations teams to provide self-service mechanisms to users throughout the business, as well as setup event-driven automation for workflows with Kubernetes.
Available in Rundeck Open Source
Plugin Name | Plugin Type | Description |
---|---|---|
Create Deployment | Node Step | Create a new deployment. |
Delete Deployment | Node Step | Delete an existing deployment. |
Deployment Status | Node Step | Get the status of an existing deployment. |
Update Deployment | Node Step | Update an existing deployment. |
Waitfor Deployment | Node Step | Pause workflow until deployment is complete. |
Create Job | Node Step | Create a new Kubernetes job. |
Delete Job | Node Step | Delete an existing Kubernetes job. |
Re-run Job | Node Step | Re-runs an existing Kubernetes job. |
Waitfor Job | Node Step | Pause workflow until Kubernetes job is complete. |
Create Service | Node Step | Create a new Kubernetes service. |
Update Service | Node Step | Update an existing Kubernetes service. |
Delete Service | Node Step | Delete an existing Kubernetes service. |
Pods Node Source | Resource Model | Populates node inventory with Kubernetes pods. |
Create Pod | Node Step | Create a new Kubernetes pod. |
Delete Pod | Node Step | Delete an existing Kubernetes pod. |
Describe Pod | Node Step | Describe a running Kubernetes pod. |
Execute Command | Node Step | Execute a command inside a container in a running pod. |
Execute Script | Node Step | Execute a script inside a container in a running pod. |
Pod Logs | Node Step | View the logs of a running pod. |
Waitfor Pod | Node Step | Pause workflow until pod is in "ready" state. |
Debug Pod | Node Step | Debug a running container inside an existing pod using an ephemeral container. |
Waitfor StatefulSet | Node Step | Pause workflow until StatefulSet has been successfully deployed. |
Plugins available only in Commercial products
Note: All Open Source plugins also included.
Plugin Name | Plugin Type | Description |
---|---|---|
Amazon EKS Node Source | Node Source | Imports Amazon Web Services EKS Clusters as Nodes. |
Azure AKS Node Source | Node Source | Imports Azure AKS Clusters as Nodes. |
Google Cloud GKE Node Source | Node Source | Imports Google Cloud GKE Clusters as Nodes. |
Kubernetes Cluster Create Object | Node Step | This plugin creates an object of a selected kind within a Kubernetes cluster. |
Kubernetes Cluster Delete Object | Node Step | This plugin deletes an object of a selected kind within a Kubernetes cluster. |
Kubernetes Cluster Describe Object | Node Step | This plugin describes an object of a selected kind within a Kubernetes cluster. |
Kubernetes Cluster List Objects | Node Step | This plugin lists objects of a selected kind within a Kubernetes cluster. |
Kubernetes Cluster Object Logs | This plugin allows you to view the logs of an object within a Kubernetes cluster. | |
Kubernetes Cluster Run Command | Node Step | This plugin allows you to execute a command in a pod within a Kubernetes cluster. |
Kubernetes Cluster Run Script | Node Step | This plugin executes a script using a predefined container image within a Kubernetes cluster. |
Kubernetes Cluster Update Object | Node Step | This plugin updates a specified object of a selected kind within a Kubernetes cluster. |
Tips
Click above see the full list of plugins for Kubernetes.
Setup the Open Source Kubernetes Plugins
Python Dependencies
In order to use the Open Source Kubernetes plugins listed in the Summary above, Python must be installed on the Runbook Automation cluster-members or on the Enterprise Runner - depending on where the connection to Kubernetes will originate. (These steps are also needed for Commercial versions using the listed Open Source plugins.)
The plugins will work with both Python 2.7.x and Python 3.x.x.
Once python is installed, download and install the kubernetes
python client. For Python 2.7.x this can be done with pip install kubernetes
and for Python 3.x.x this can be done with pip3 install kubernetes
.
Optionally test that the Kubernetes client has been installed successfully by executing the following at the command-line: python
followed by from kubernetes import client, config
:
ubuntu@ip-172-31-13-91:~$ python
Python 2.7.17 (default, Mar 8 2023, 18:40:28)
[GCC 7.5.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from kubernetes import client, config
>>>
Kubernetes Authentication
By default, the Kubernetes plugins look for a Kube Config file at $RDECK_BASE/.kube/config
. For Deb and RPM this would translate to /var/lib/rundeck/.kube/config
.
The Kube Config file can be saved to a different location, just be sure to take note of where it is saved for later steps.
If it is preferred to use a Kubernetes API Token, then follow the instructions outlined here to generate the Service Account Token.
Once created, save the Token to Key Storage as a Password secret type.
Upload Kubernetes Plugins (Rundeck OSS Only)
Rundeck OSS does not come preloaded with the Kubernetes plugins. To install the Kubernetes plugins, use the following steps:
- Navigate to the latest plugin release on Github and download the
kubernetes-X.X.XX.zip
file. - In Rundeck, click the Gear Icon and then click the Plugins > Upload Plugin:
- Click Browse and select the downloaded
.zip
file from Step 2. - Click Install:
Test Kubernetes Plugins
To test that the dependencies and authentication have been configured correctly, use a Kubernetes Node Step plugin - as this will provide the option to easily
execute the plugin in debug mode.
- Create a new Job.
- Navigate to the Workflow tab.
- Click + Add a step.
- In the Search step field type
Kubernetes
. - Select the Kubernetes / Pod / Describe plugin from the list.
- Type in a pod name into the Name field.
- Type in the namespace of the pod in the Namespace field.
- If the Kube Config file is saved in the directory
$RDECK_BASE/.kube/config
(/var/lib/rundeck/.kube/config
for RPM and Deb), then the authentication fields can be left blank.- Otherwise, specify the custom Kube Config location.
- Optionally chance the Python Interpreter if python scripts are not invoked using
python my_script.py
but ratherpython2 my_script.py
orpython3 my_script.py
. - Click Save on the Job Step and then Save to save the Job.
- Click Run Job Now to test that the configuration is correct.
Now that configuration is complete, take a look at use-cases for Runbook Automation with Kubernetes such as
Capturing Debug Data from Apps in Kubernetes
or Managing Kubernetes with Rundeck.