Skip to main content

A full-featured Python SDK for Kubernetes

Project description

kube-orchestrator

PyPI version PyPI downloads Python versions Tests Coverage Code style: black License: MIT

A full-featured Python SDK for Kubernetes — programmatic kubectl, GitOps engine, platform engineering SDK.


Table of Contents


Features

  • Full Kubernetes resource coverage — Pods, Deployments, StatefulSets, DaemonSets, Jobs, CronJobs, and more
  • Programmatic kubectl — apply, delete, get, list, patch any resource from Python
  • GitOps engine — load and apply YAML/JSON manifests with full validation
  • Manifest Renderer — lightweight Helm-like templating engine
  • Auto Rollback — detect failures and roll back deployments automatically
  • Scaling Engine — HPA management and custom scaling watchers
  • RBAC management — Roles, ClusterRoles, Bindings, ServiceAccounts
  • Network management — Services, Ingress, NetworkPolicies, Endpoints
  • Storage management — ConfigMaps, Secrets, PVs, PVCs, StorageClasses
  • CRD Framework — install and manage Custom Resource Definitions
  • CLI DevOps Toolkube-orch command for terminal workflows
  • Fully typed — PEP 561 compliant, works with mypy and pyright
  • Python 3.10+ — modern Python, full type hints

Installation

pip install kube-orchestrator

Quick Start

from kube_orchestrator import KubeClient, PodManager

# Connect to cluster
client = KubeClient.from_kubeconfig()

# List all pods in a namespace
pod_manager = PodManager(client)
pods = pod_manager.list(namespace="default")
for pod in pods:
    print(pod.name, pod.status.phase)
from kube_orchestrator import KubeClient, DeploymentManager

client = KubeClient.from_kubeconfig()
deploy_manager = DeploymentManager(client)

# Scale a deployment
deploy_manager.scale(name="my-app", namespace="default", replicas=5)
from kube_orchestrator import KubeClient, ManifestApplier

client = KubeClient.from_kubeconfig()
applier = ManifestApplier(client)

# Apply a manifest file (like kubectl apply -f)
applier.apply_file("manifests/deployment.yaml")
from kube_orchestrator import KubeClient, AutoRollback

client = KubeClient.from_kubeconfig()
rollback = AutoRollback(client)

# Watch a deployment and auto-rollback on failure
rollback.watch(name="my-app", namespace="default", timeout=300)
from kube_orchestrator import KubeClient, ClusterHealthReporter

client = KubeClient.from_kubeconfig()
reporter = ClusterHealthReporter(client)

# Get a full cluster health report
report = reporter.full_report()
print(report.summary())

Architecture

kube-orchestrator
├── core/               # KubeClient, KubeConfig, logging, errors
├── resources/
│   ├── workloads/      # Pod, Deployment, StatefulSet, DaemonSet, Job, CronJob
│   ├── networking/     # Service, Ingress, NetworkPolicy, Endpoints
│   ├── storage/        # ConfigMap, Secret, PV, PVC, StorageClass
│   ├── rbac/           # Role, ClusterRole, Bindings, ServiceAccount
│   └── cluster/        # Namespace, Node, HPA, ResourceQuota, LimitRange
├── manifest/           # Loader, Validator, Renderer, Applier
├── crd/                # CRD installer and custom object manager
├── monitoring/         # ClusterHealthReporter
├── rollback/           # AutoRollback system
├── scaling/            # ScalingEngine, ResourceWatcher
└── cli/                # kube-orch CLI tool

Supported Resources

Resource List Get Create Update Delete Patch
Pod
Deployment
StatefulSet
DaemonSet
ReplicaSet
Job
CronJob
Service
Ingress
NetworkPolicy
ConfigMap
Secret
PersistentVolume
PersistentVolumeClaim
StorageClass
Namespace
Node
Role / ClusterRole
RoleBinding / ClusterRoleBinding
ServiceAccount
HPA
ResourceQuota
CRD

Documentation

Full documentation, including the API reference and guides, lives in the docs/ folder — start at docs/index.md.


Contributing

Contributions are welcome! Please read CONTRIBUTING.md before submitting a PR.


License

This project is licensed under the MIT License — see LICENSE for details.


Acknowledgements

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

kube_orchestrator-1.0.0.tar.gz (209.3 kB view details)

Uploaded Source

Built Distribution

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

kube_orchestrator-1.0.0-py3-none-any.whl (137.5 kB view details)

Uploaded Python 3

File details

Details for the file kube_orchestrator-1.0.0.tar.gz.

File metadata

  • Download URL: kube_orchestrator-1.0.0.tar.gz
  • Upload date:
  • Size: 209.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for kube_orchestrator-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1dc9f48350e050e6a0884978c901a96147b33757b2cf4650b5bab554faa5a0c5
MD5 fde7b00865feb20a4442d6367277291a
BLAKE2b-256 da2f16c5bca81ef4923bde4d3626d219ae23b4e93210932ae6803b383774d3fd

See more details on using hashes here.

Provenance

The following attestation bundles were made for kube_orchestrator-1.0.0.tar.gz:

Publisher: release.yml on AbbesCheriif/kube-orchestrator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kube_orchestrator-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for kube_orchestrator-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d7ec2b6b5ac287ee0525ea08bf81aceddf9caafadd12ccda393bd3bbec59f8d5
MD5 70f90450e2fd81a9cab343d560ff1370
BLAKE2b-256 ccd37fa0a5db94e092161967abeb9aa7d84b8cc96da742184f1b57346af6c67a

See more details on using hashes here.

Provenance

The following attestation bundles were made for kube_orchestrator-1.0.0-py3-none-any.whl:

Publisher: release.yml on AbbesCheriif/kube-orchestrator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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