Source: factory.deploy/extend.substrate/ObjK3s.py
K3s/Kubernetes substrate.
Manages pods, deployments, and services via
kubectl. Mirrors the ObjDocker interface for
consistency across substrates.
| Method | Signature | Description |
|---|---|---|
| connect | connect() -> bool |
Verify kubectl can reach the cluster. |
| list_instances | list_instances() -> List[Dict[str, Any]] |
List all pods in the namespace. |
| get_instance | get_instance(name: str) -> Optional[Dict[str, Any]] |
Get a pod by name. |
| create_instance | create_instance(config: Dict[str, Any]) -> bool |
Apply a k8s manifest from a dict. |
| start_instance | start_instance(name: str) -> bool |
Scale a deployment to 1 replica. |
| stop_instance | stop_instance(name: str, force: bool = False) -> bool |
Scale a deployment to 0 replicas. |
| delete_instance | delete_instance(name: str, force: bool = False) -> bool |
Delete a pod. |
| execute_command | execute_command(name: str, command: List[str]) -> Optional[Dict[str, Any]] |
Exec into a running pod. |
| get_deployments | get_deployments() -> List[Dict[str, Any]] |
List all deployments. |
| get_services | get_services() -> List[Dict[str, Any]] |
List all services. |
| scale | scale(deployment: str, replicas: int) -> bool |
Scale a deployment. |
| rollout_restart | rollout_restart(deployment: str) -> bool |
Rolling restart a deployment. |
| get_logs | get_logs(pod: str, tail: int = 100, container: str = '') -> str |
Get pod logs. |
| get_events | get_events(limit: int = 20) -> str |
Get recent namespace events. |
| apply_file | apply_file(manifest: str) -> bool |
Apply a YAML/JSON manifest file. |
| delete_file | delete_file(manifest: str) -> bool |
Delete resources from a manifest file. |
List pods.
List deployments.
List services.
Get pod logs.
Scale a deployment.
Rolling restart a deployment.