{
"name": "disk-cleanup",
"namespace": "production",
"description": "Free disk space when a StatefulSet reports disk pressure",
"trigger": {
"signalType": "disk_pressure",
"severity": "medium",
"resourceKind": "StatefulSet"
},
"steps": [
{
"name": "diagnose",
"action": "ExecDiagnostic",
"description": "Check filesystem usage",
"params": {
"command": "df -h"
}
},
{
"name": "restart-pod",
"action": "RestartStatefulSetPod",
"description": "Restart the affected pod"
}
],
"labels": {
"team": "storage"
}
}
curl -X POST -H "X-API-Key: $KEY" -H "Content-Type: application/json" \
-d @runbook.json http://localhost:8090/api/v1/runbooks
{
"apiVersion": "v1",
"kind": "Runbook",
"spec": {
"name": "disk-cleanup",
"namespace": "production",
"description": "Free disk space when a StatefulSet reports disk pressure",
"trigger": {
"signalType": "disk_pressure",
"severity": "medium",
"resourceKind": "StatefulSet"
},
"steps": [
{
"name": "diagnose",
"action": "ExecDiagnostic",
"description": "Check filesystem usage",
"params": {
"command": "df -h"
}
},
{
"name": "restart-pod",
"action": "RestartStatefulSetPod",
"description": "Restart the affected pod"
}
],
"maxAttempts": 3,
"creationTimestamp": "2026-03-19T16:00:00Z"
},
"resourceMeta": {
"name": "disk-cleanup",
"namespace": "production",
"uid": "7d8e9f0a-1b2c-4d3e-9f4a-5b6c7d8e9f0a",
"creationTimestamp": "2026-03-19T16:00:00Z",
"labels": {
"team": "storage"
}
}
}
Criar Runbook
Cria um novo recurso Runbook
{
"name": "disk-cleanup",
"namespace": "production",
"description": "Free disk space when a StatefulSet reports disk pressure",
"trigger": {
"signalType": "disk_pressure",
"severity": "medium",
"resourceKind": "StatefulSet"
},
"steps": [
{
"name": "diagnose",
"action": "ExecDiagnostic",
"description": "Check filesystem usage",
"params": {
"command": "df -h"
}
},
{
"name": "restart-pod",
"action": "RestartStatefulSetPod",
"description": "Restart the affected pod"
}
],
"labels": {
"team": "storage"
}
}
curl -X POST -H "X-API-Key: $KEY" -H "Content-Type: application/json" \
-d @runbook.json http://localhost:8090/api/v1/runbooks
{
"apiVersion": "v1",
"kind": "Runbook",
"spec": {
"name": "disk-cleanup",
"namespace": "production",
"description": "Free disk space when a StatefulSet reports disk pressure",
"trigger": {
"signalType": "disk_pressure",
"severity": "medium",
"resourceKind": "StatefulSet"
},
"steps": [
{
"name": "diagnose",
"action": "ExecDiagnostic",
"description": "Check filesystem usage",
"params": {
"command": "df -h"
}
},
{
"name": "restart-pod",
"action": "RestartStatefulSetPod",
"description": "Restart the affected pod"
}
],
"maxAttempts": 3,
"creationTimestamp": "2026-03-19T16:00:00Z"
},
"resourceMeta": {
"name": "disk-cleanup",
"namespace": "production",
"uid": "7d8e9f0a-1b2c-4d3e-9f4a-5b6c7d8e9f0a",
"creationTimestamp": "2026-03-19T16:00:00Z",
"labels": {
"team": "storage"
}
}
}
disk-cleanup)Mostrar Propriedades do trigger
Mostrar Propriedades do trigger
oom_kill, crashloop_backoff, error_rate, latency, pod_restart, cpu_high, memory_high, disk_pressure, image_pull_error (lista completa no enum do CRD Anomaly)critical, high, medium ou lowDeployment, StatefulSet, DaemonSet, Job, CronJobMostrar Propriedades do passo
Mostrar Propriedades do passo
AdjustResources, RestartDeployment, ScaleDeployment, RollbackDeployment, ExecDiagnostic{"memory_limit": "1Gi"}, {"replicas": "5"})201 Created, com o runbook em spec e os metadados em resourceMeta. name ausente ou JSON malformado retornam 400; uma falha da API do Kubernetes retorna a mensagem do API server com o status correspondente: 409 só quando já existe um runbook com esse nome, 422 quando o API server rejeita o objeto (valor fora dos enums do CRD, campo obrigatório ausente), 403 quando o operator não tem permissão para criá-lo e 500 nos demais casos.
{
"name": "disk-cleanup",
"namespace": "production",
"description": "Free disk space when a StatefulSet reports disk pressure",
"trigger": {
"signalType": "disk_pressure",
"severity": "medium",
"resourceKind": "StatefulSet"
},
"steps": [
{
"name": "diagnose",
"action": "ExecDiagnostic",
"description": "Check filesystem usage",
"params": {
"command": "df -h"
}
},
{
"name": "restart-pod",
"action": "RestartStatefulSetPod",
"description": "Restart the affected pod"
}
],
"labels": {
"team": "storage"
}
}
curl -X POST -H "X-API-Key: $KEY" -H "Content-Type: application/json" \
-d @runbook.json http://localhost:8090/api/v1/runbooks
{
"apiVersion": "v1",
"kind": "Runbook",
"spec": {
"name": "disk-cleanup",
"namespace": "production",
"description": "Free disk space when a StatefulSet reports disk pressure",
"trigger": {
"signalType": "disk_pressure",
"severity": "medium",
"resourceKind": "StatefulSet"
},
"steps": [
{
"name": "diagnose",
"action": "ExecDiagnostic",
"description": "Check filesystem usage",
"params": {
"command": "df -h"
}
},
{
"name": "restart-pod",
"action": "RestartStatefulSetPod",
"description": "Restart the affected pod"
}
],
"maxAttempts": 3,
"creationTimestamp": "2026-03-19T16:00:00Z"
},
"resourceMeta": {
"name": "disk-cleanup",
"namespace": "production",
"uid": "7d8e9f0a-1b2c-4d3e-9f4a-5b6c7d8e9f0a",
"creationTimestamp": "2026-03-19T16:00:00Z",
"labels": {
"team": "storage"
}
}
}
{
"apiVersion": "v1",
"kind": "Error",
"error": "Bad Request",
"code": 400,
"message": "name is required"
}
{
"apiVersion": "v1",
"kind": "Error",
"error": "Conflict",
"code": 409,
"message": "failed to create runbook: runbooks.platform.chatcli.io \"disk-cleanup\" already exists"
}
Autorizações
API key sent in the X-API-Key header. Keys are read from the Secret chatcli-operator-secrets, key api-keys (fallback: ConfigMap chatcli-operator-config, key api-keys) in the operator namespace, as a YAML list of {key, role, name, description} (name is the identity recorded on approval decisions); the operator chart creates it only with apiKeys.create: true. Roles: viewer < operator < admin — any other role string is denied everywhere. Changes are picked up within about 30 seconds; deleting both the Secret and the ConfigMap revokes every key. With no keys configured every /api/ call returns 401, unless CHATCLI_OPERATOR_DEV_MODE=true, which grants admin without a key (development only).
Corpo
Required on create; ignored on update.
"oom-standard"
Create only; ignored on update.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Defaults to 3 on create; on update only values > 0 are applied.
Show child attributes
Show child attributes