feat: Implement Kubernetes client and example

- Add Kubernetes client module for interacting with kubectl
- Implement methods to get cluster info, pods, deployments, and services
- Create a Kubernetes example script demonstrating client usage
- Add JSON response structs for parsing kubectl output
- Define runtime resource structs (Pod, Deployment, Service) for structured data
- Include comprehensive unit tests for data structures and client logic
This commit is contained in:
Mahmoud-Emad
2025-10-29 16:46:37 +03:00
parent 79b78aa6fe
commit c556cc71d4
14 changed files with 987 additions and 385 deletions

View File

@@ -1,8 +1,6 @@
module kubernetes
import incubaid.herolib.data.paramsparser
import incubaid.herolib.data.encoderhero
import os
pub const version = '0.0.0'
const singleton = false
@@ -12,9 +10,9 @@ const default = true
pub struct KubeClient {
pub mut:
name string = 'default'
kubeconfig_path string
config KubeConfig
connected bool
kubeconfig_path string // Path to kubeconfig file
config KubeConfig // Kubernetes configuration
connected bool // Connection status
api_version string = 'v1'
cache_enabled bool = true
cache_ttl_seconds int = 300