Complete guide for creating and managing runbooks
This feature is yet to be implemented in the newer version. Please be patient, you will get this feature in future updates.
Runbookss are a sequence of steps designed to handle Kubernetes operations and gain insights into incidents within the cluster. They can be defined through YAML configuration or managed via the Agentkube dashboard. This documentation explains the structure and components of a Runbooks YAML file.
Here’s a quick sample of a Runbooks that you can import into your Agentkube dashboard to get started. Use this as a foundation to create your own custom protocol based on your cluster’s needs: Kubernetes Resource Health Check Protocol
Runbookss can be created in two ways:
This guide focuses on the YAML file structure for users who prefer to create or manage protocols programmatically.
The name of the Runbooks
A detailed description of the protocol’s purpose
An array of step objects defining the protocol workflow
Each step in the steps
array has the following properties:
The title of the step
The step number (must be unique and sequential)
Detailed description of the step
Array of command objects to be executed
Array of next step objects defining workflow transitions
Each command in the commands
array has the following properties:
The actual command to be executed
Documentation describing the command’s purpose
Example usage of the command
If true, command cannot be modified (default: false)
Each object in the nextSteps
array has the following properties:
Type of reference: “STEP”, “FINAL”, or “STOP”
Required when referenceType is “STEP”
Array of condition strings
If true, conditions are ignored (default: false)
The referenceType
field can have one of three values:
STEP
: Proceed to another step (requires targetStepNumber)FINAL
: End the protocol successfullySTOP
: Terminate the protocolConditions are expressions that determine when a next step should be taken. In the Kubernetes example, conditions are written in natural language for clarity:
Sequential Numbering
Use sequential numbers starting from 1, as shown in the Kubernetes example (1 through 4)
Uniqueness
Ensure numbers are unique within the protocol
Documentation
Use clear, descriptive docStrings that explain the command’s purpose
Examples
Provide practical examples with useful flags, like sorting and output formatting:
Access Control
Use readOnly flag appropriately to control command modification
Flow Definition
Define clear transitions between steps using conditions
Conditions
Use clear, actionable conditions that guide the operator
Terminal States
Include both FINAL (success) and STOP (critical issues) states
The YAML parser validates:
Common errors to watch for:
Syntax Validation
Validate YAML syntax
Path Testing
Test all possible paths through the workflow:
Command Testing
Verify all kubectl commands work as expected
Error Handling
Test error scenarios and condition handling