Skip to main content

A CKAD (Certified Kubernetes Application Developer) exam preparation assistant

Project description

CKAD Agent

A powerful AI-powered agent. This tool leverages large language models to help you understand, debug, and generate Kubernetes configurations.

Features

  • 🐛 Debug Kubernetes YAML manifests
  • 📚 Explain Kubernetes concepts and best practices
  • ✨ Generate valid Kubernetes YAML from requirements
  • ✅ Validate and improve existing configurations

Installation

  1. Install the package:

    pip install ckad-agent
    
  2. Create a .env file with your OpenAI API key:

    cp .env.example .env
    # Edit .env and add your OpenAI API key
    

Usage

Command Line Interface

The CKAD Agent provides a convenient CLI for common tasks:

# Debug issues in read-only mode
ckad debug "My pod in namespace default keeps crashing, fix it" --read-only

# Debug and correct issues (Project in development be carefull, do not use it in production environment)
ckad debug "My pod in namespace default keeps crashing, fix it" --no-read-only

# Explain a Kubernetes concept
ckad explain "How do I configure liveness and readiness probes?"

# Validate a YAML file
ckad validate deployment.yaml --resource Deployment

Python API

from ckad_agent import CkadAgent, CKADRequest, TaskType, KubernetesResourceType
import asyncio

async def main():
    agent = CkadAgent()
    
    # Example: Debug a YAML
    request = CKADRequest(
        task_type=TaskType.DEBUG,
        resource_type=KubernetesResourceType.POD,
        yaml_content="""
        apiVersion: v1
        kind: Pod
        metadata:
          name: my-pod
        spec:
          containers:
          - name: nginx
            image: nginx:latest
        """,
        question="Why isn't this pod starting?"
    )
    
    response = await agent.process_request(request)
    print(response.solution)

asyncio.run(main())

Development with uv

Prerequisites

  • Install uv (if not already installed):
    curl -LsSf https://astral.sh/uv/install.sh | sh
    
    Or install via pip:
    pip install uv
    

Setup and Development

  1. Clone the repository
  2. Create and activate a virtual environment:
    uv venv
    source .venv/bin/activate  # On macOS/Linux
    # .\.venv\Scripts\activate  # On Windows
    
  3. Install the package in development mode with all dependencies:
    uv pip install -e ".[dev]"
    
  4. Run tests:
    pytest
    

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ckad_agent-0.3.0.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ckad_agent-0.3.0-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file ckad_agent-0.3.0.tar.gz.

File metadata

  • Download URL: ckad_agent-0.3.0.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.0

File hashes

Hashes for ckad_agent-0.3.0.tar.gz
Algorithm Hash digest
SHA256 d2d8ffc5b1ce07e246fe48b876c546a09e1358290baf2f3292f0a9fd19cab0fb
MD5 b09cd7417c448f4bdd2546b5090c33f1
BLAKE2b-256 f4bf05f42bf1c61425778d8f8e8fa486b7e1543a151b4a3c19dfdf947b0fa68a

See more details on using hashes here.

File details

Details for the file ckad_agent-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: ckad_agent-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 13.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.0

File hashes

Hashes for ckad_agent-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9494fda988aef10d425b016e1ca96f0dff119d963f0b50243adeb4c8b3c77f7a
MD5 5a226516b18203512a7c3b7685b132b3
BLAKE2b-256 49e961c0073be85b6b3bce9c4b1f76301166961c6f6296aeb104ccfe097db0d9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page