πŸ’€ KubeNidra

KubeNidra API v1

The KubeNidra API provides a RESTful interface for managing workload hibernation in Kubernetes clusters. This API allows you to enable, disable, and control KubeNidra behavior for various workload types including Deployments, StatefulSets, DaemonSets, and ReplicaSets.

Base URL

http://192.168.1.13:1881

API Version

All endpoints are prefixed with /api/v1/

Supported Workload Types

  • Deployments: Most common workload type for stateless applications
  • StatefulSets: Stateful applications with persistent storage
  • DaemonSets: Node-level workloads that run on every node
  • ReplicaSets: Direct replica set management

Core Operations

Enable/Disable

  • Enable KubeNidra monitoring and management for workloads
  • Disable KubeNidra and restore normal Kubernetes behavior

Manual Control

  • Manually snooze workloads (scale to 0 replicas)
  • Wake up snoozed workloads (restore original replica count)

Schedule Management

  • Set and update wake schedules using cron-like format
  • Example: "09:00-17:00,mon-fri" for weekdays 9 AM to 5 PM

Override Control

  • Set temporary or permanent manual overrides
  • Clear overrides to restore automatic behavior

State Pinning

  • Pin workloads in their current state (active or snoozed)
  • Remove pins to restore normal KubeNidra behavior

Authentication

Currently, the API does not require authentication, but this may change in future versions.

Response Format

All API responses follow a consistent format:

{
  "success": true,
  "message": "Operation completed successfully",
  "data": {},
  "timestamp": "2024-01-15T10:30:00Z"
}

Error Handling

Errors are returned with appropriate HTTP status codes and detailed error messages:

{
  "success": false,
  "error": {
    "code": "NOT_FOUND",
    "message": "Resource not found",
    "details": {}
  },
  "timestamp": "2024-01-15T10:30:00Z"
}