PHPackages                             travisghansen/kubernetes-client-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. travisghansen/kubernetes-client-php

ActiveLibrary[HTTP &amp; Networking](/categories/http)

travisghansen/kubernetes-client-php
===================================

Kubernetes API client in PHP supporting REST operations and Watches

v0.4.5(1y ago)3726.0k↓18.1%11[1 PRs](https://github.com/travisghansen/kubernetes-client-php/pulls)3Apache-2.0PHPPHP &gt;=7.2.0

Since May 22Pushed 1y ago3 watchersCompare

[ Source](https://github.com/travisghansen/kubernetes-client-php)[ Packagist](https://packagist.org/packages/travisghansen/kubernetes-client-php)[ Docs](https://github.com/travisghansen/kubernetes-client-php/)[ RSS](/packages/travisghansen-kubernetes-client-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (18)Used By (3)

Intro
=====

[](#intro)

No nonsense PHP client for the Kubernetes API. It supports standard `REST` calls along with `watch`es for a continuous feed of data. Because no models are used it's usable with `CRD`s and other functionality/endpoints that may not be built-in.

Example
=======

[](#example)

See [sample.php](sample.php)

Watches
=======

[](#watches)

Watches can (will) stay connected indefinitely, automatically reconnecting after server-side timeout. The client will keep track of the most recent `resourceVersion` processed to automatically start where you left off.

Watch callback closures should have the following signature:

```
$callback = function($event, $watch)..

```

Receiving the watch allows access to the client (and any other details on the watch) and also provides an ability to stop the watch (break the loop) based off of event logic.

- `GET /apis/batch/v1beta1/watch/namespaces/{namespace}/cronjobs/{name}` (specific resource)
- `GET /apis/batch/v1beta1/watch/namespaces/{namespace}/cronjobs` (resource type namespaced)
- `GET /apis/batch/v1beta1/watch/cronjobs` (resource type cluster-wide)
-

Other notes:

- if using labelSelectors triggered events will fire with ADDED / DELETED types if the label is added/delete (ie: ADDED/DELETED do not necessarily equate to literally being added/deleted from k8s)

Development
===========

[](#development)

Note on `resourceVersion` per the doc:

> When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

Note that it's only changes **after** the version.

TODO
----

[](#todo)

- Introduce threads for callbacks?
- Do codegen on swagger docs to provide and OO interface to requests/responses?

Links
-----

[](#links)

-
-
-
-
-
-
-
-
-
- [kubernetes-client/python#124](https://github.com/kubernetes-client/python/issues/124)

Async
-----

[](#async)

-
-
-

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance45

Moderate activity, may be stable

Popularity41

Moderate usage in the ecosystem

Community22

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~133 days

Total

17

Last Release

422d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d74fac235db729c441642ba84858af4404e8e39be614455c7aed9c07339c9340?d=identicon)[travisghansen](/maintainers/travisghansen)

---

Top Contributors

[![travisghansen](https://avatars.githubusercontent.com/u/225404?v=4)](https://github.com/travisghansen "travisghansen (40 commits)")[![NuclearDog](https://avatars.githubusercontent.com/u/1182715?v=4)](https://github.com/NuclearDog "NuclearDog (3 commits)")[![erinbit](https://avatars.githubusercontent.com/u/54077578?v=4)](https://github.com/erinbit "erinbit (2 commits)")[![willnewby](https://avatars.githubusercontent.com/u/1313599?v=4)](https://github.com/willnewby "willnewby (2 commits)")[![beschoenen](https://avatars.githubusercontent.com/u/1887585?v=4)](https://github.com/beschoenen "beschoenen (1 commits)")

---

Tags

apiclientk8skubernetesphpphpapiclientrestkubernetesk8s

### Embed Badge

![Health badge](/badges/travisghansen-kubernetes-client-php/health.svg)

```
[![Health](https://phpackages.com/badges/travisghansen-kubernetes-client-php/health.svg)](https://phpackages.com/packages/travisghansen-kubernetes-client-php)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
