teknoo/kubernetes-client
Teknoo Kubernetes Client is a PHP library for interacting with Kubernetes clusters through its API. Manage pods, deployments, services and other resources programmatically with a clean, object-oriented client suited to automation tools, controllers and integrations.
Architecture fit
ServiceProvider, no facade, no config stub, and no publishable assets. Any Laravel adoption means we own a thin integration layer (provider + config + facade) ourselves — roughly half a day of work, but it becomes our code to maintain forever.src/Collection/ extends Illuminate collections and the README/AGENTS notes describe Illuminate as a dependency. That means the maintainer has already accepted Laravel's support library as a contract, and the ergonomics (collections of Pods, filtering, mapping) line up with how our developers already work.Client as entry point, RepositoryRegistry for $client->pods()-style accessors, Model/Attribute/Explorer for attribute traversal, Repository/Strategy/PatchMergeTrait for CRDs, PSR-18 HTTP client discovery across curl/socket/Guzzle7/Symfony adapters. Nothing exotic; a mid-level Laravel developer can read the source in an afternoon.Integration feasibility
illuminate/collections constraint is compatible with our pinned Laravel major. A loose or over-tight constraint here can deadlock composer update across the monorepo.php-http/guzzle7-adapter satisfies discovery with no new egress or proxy behaviour — provided the package's HttpClientDiscovery respects our existing proxy/CA-bundle conventions rather than constructing its own.Client::setTmpDir()) is where feasibility actually gets decided. This works on a VM; in our containerised, read-only-root-filesystem deployments it needs an explicit writable emptyDir and a cleanup story. Service-account token projection and short-lived tokens are the common case for us, and the summary does not establish support for kubeconfig exec credential plugins — a likely blocker if we target EKS/GKE/AKS.kubernetes/php-client (OpenAPI-generated, broader resource coverage, historically stale); (b) shelling out to kubectl from queued jobs (zero code, terrible error handling, no typed responses); (c) running this package. Given 3 stars and 0 dependents, option (c) is the highest-uncertainty path and should be justified by a concrete requirement the other two can't meet — most plausibly CRD interaction via PatchMergeTrait, or a typed, testable object model inside a Laravel service class.Technical risk
| Risk | Severity | Notes |
|---|---|---|
| Abandonment | High | 3 stars, 0 dependents, single-vendor (Teknoo). Effectively zero external contributors to absorb maintainer loss. |
| PHP 8.4 floor | High | Blocks the majority of our current runtime estate until a platform upgrade lands. |
| Security posture | High | A client handling cluster credentials with no visible security policy or disclosure process. We would be trusting unreviewed TLS/temp-file handling against a production control plane. |
| API drift | Medium | Kubernetes deprecates resource versions on a steady cadence. A low-traffic client will lag; we inherit the upgrade work. |
| Behavioural regressions | Low–Medium | Mitigated well by the dual test suite and stated "existing tests must not be modified" policy — a genuinely good signal about maintainer intent. |
| License | Low | BSD-3-Clause is permissive and compatible with our stack; attribution obligation only. |
Key questions
Client support kubeconfig exec credential plugins and projected service-account tokens, or only static tokens and inline PEM? This single answer may decide the evaluation.illuminate/collections constraint, and is it satisfiable on our pinned Laravel major without a --with-all-dependencies cascade?HttpClientDiscovery interact with HTTPS_PROXY, NO_PROXY and a custom CA bundle? Does it inherit our adapter configuration or override it?setTmpDir() is never called?watch connections (long-lived, chunked, reconnect), or only request/response?Retry-After) or retry policy, or is that entirely the caller's problem?Stack fit
$client->pods() on a schedule, results into Eloquent, broadcast to the UI). This is the lowest-risk, highest-value first use case.collect() pipelines and Blade/Livewire views without an adapter layer.Migration path
kind/k3d cluster. Validate the four unknowns: auth mode, proxy/CA behaviour, temp-dir handling under a read-only rootfs, and collection ergonomics.KubernetesServiceProvider binding a configured Client as a singleton, with config/kubernetes.php mapping kubeconfig path, context, tmp dir, timeouts and TLS material from environment/secret store. Expose a narrow ClusterReader interface; every controller and job depends on the interface, never on Teknoo\Kubernetes\Client. This is the single highest-leverage decision — it makes the eventual swap to the official client or kubectl a one-class change.Compatibility
"teknoo/kubernetes-client": "x.y.z"), not with a caret. With zero external dependents there is no ecosystem pressure to keep it stable, and the stated policy is that public API must not break — good, but unverified by third parties.Sequencing
Platform PHP 8.4 upgrade → vendor review (security policy, auth plugin support, release cadence) → isolated spike in kind → service provider + config + ClusterReader wrapper with contract tests against a fake API server modeled on the package's own Behat approach → read-only production feature → write operations behind flag with least-privilege RBAC.
The go/no-go sits between steps 2 and 3, and hinges entirely on exec-plugin/service-account auth and the PHP 8.4 timeline.
Maintenance
ClusterReader) is a permanent line item. Small, but it is code we wrote and must maintain, and it does not exist as a community artifact we can hand off.Support
Scaling
fieldSelector/labelSelector and namespace scoping in the wrapper.Client as a singleton in an Octane worker should be validated for connection reuse and temp-file leakage across requests — this is a specific Octane risk given the temp-file ownership model.Failure modes
| Failure | Symptom | Mitigation |
|---|---|---|
| PHP/Composer constraint drift | composer update deadlock across monorepo |
Exact pin; renovate in isolation |
| Expired credentials / unsupported exec plugin | 401 on every call, all features dark | Health-check command; fail loudly at boot |
| Temp-file leak or read-only rootfs | TLS handshake failures, disk pressure | Writable emptyDir, setTmpDir(), monitoring |
| API server unreachable / control-plane incident | Cascading timeouts into queued jobs | Hard timeouts, circuit breaker, queue backoff |
| 429 throttling | Intermittent failures under polling load | Jittered polling, selector scoping; verify client support before relying on it |
| Kubernetes API deprecation | Silent 404/410 on a resource version | Contract tests pinned to a cluster version in CI |
| Unvalidated write path | Deleting or patching the wrong resource | Dry-run, least-privilege RBAC, audit-before-act |
| Maintainer abandonment | No fixes for a PHP 8.5 or K8s 1.34 break | Fork readiness assessment before go-live |
Ramp-up
kind, answer the eight key questions, produce a two-page findings note.ClusterReader wrapper, service provider, contract tests against a fake API server.Bottom line. Technically respectable, operationally fragile. The package is well-engineered for its size but carries the risk profile of a 3-star, zero-dependent, single-maintainer project — and it imposes a PHP 8.4 floor that likely exceeds our current platform baseline. I would fund a one-week spike only if a concrete requirement (CRD interaction or a typed object model inside Laravel) cannot be met by the official client or a kubectl-from-queue approach. Otherwise the disciplined answer is to defer, revisit when PHP 8.4 is our floor, and treat the fake-API-server test harness as the reusable takeaway in the meantime.
How can I help you explore Laravel packages today?