package kube
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=3c6916dea849fb2842c4a2e8a92b6cdd
sha512=b57daa3bb4879e1f33efc157cf5c648f88455e0f7c87484d572096d46345d6a8081cc7cefb4887aa95507af8daf73b3b8570b8583106953a5ba96a874159ff00
Description
A typed Kubernetes API client and controller runtime implemented with native OCaml threads and explicit cancellation.
README
ocaml-kube
A native OCaml 5 client and controller runtime for Kubernetes®.
The current release is v0.1.2. The public API is usable, but may still evolve between minor releases while the project is in the 0.x series.
Highlights
- Typed clients for built-in resources and custom resources.
- Generated Kubernetes 1.34–1.37 API packages, plus discovery and dynamic APIs.
- Watches, reflectors, indexed caches, work queues, controllers, and leader election.
- Kubeconfig and in-cluster authentication, TLS, proxies, impersonation, and explicit cancellation.
- Pod logs, exec, attach, and port forwarding.
- CRD generation, admission and conversion webhooks, operator scaffolding, and a deterministic testkit.
- A batteries-included operator runner, declarative owned-child apply, conflict retries, standard status conditions, and compilation-checked common patterns.
Install
OCaml 5.1 or newer and OPAM are required. Install the released package with:
opam install kubeThe OPAM package installs the kube libraries and the ocaml-kube scaffolding command.
Build from source
To build the development checkout with its tests and API documentation:
opam install . --deps-only --with-test --with-doc
opam exec -- dune build @all @install @doc @codegen-check
opam exec -- dune runtestSee Getting started for client setup, a typed request, and the local integration example.
Libraries
Library | Purpose |
|---|---|
| Configuration, transport, clients, discovery, caching, and controllers |
| Versioned generated Kubernetes APIs |
| Typed custom resources and CRD generation |
| JSON codec and structural schema derivation |
| Deterministic client and controller testing |
Documentation
Guide | Covers |
|---|---|
Build, configuration, and first request | |
Typed, dynamic, subresource, and streaming clients | |
Protected credentials, bodies, Secret writes, and TokenRequest | |
Reconciliation, caching, watches, and leadership | |
Owned children, apply, retries, conditions, metrics, and tests | |
Logging, health, metrics, diagnostics, and events | |
Supported Kubernetes versions and feature floor | |
API packages, versioning, and regeneration | |
CRD schemas, codecs, and typed resources | |
OCaml-first generation and CRD import | |
Exec, attach, and port forwarding | |
Admission, conversion, and TLS serving | |
Scripted transports and integration boundaries | |
Current parity, honest gaps, and priorities | |
Strengths, tradeoffs, and when to choose it |
Release history is in CHANGES.md. See CONTRIBUTING.md, SECURITY.md, and the release checklist for project processes.
Licensed under Apache-2.0.