PHPackages                             kubernetes/php-client - 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. [API Development](/categories/api)
4. /
5. kubernetes/php-client

ActiveLibrary[API Development](/categories/api)

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

Full Kubernetes API client

v1.21.11(3y ago)6097.5k—3.3%8[3 issues](https://github.com/allansun/kubernetes-php-client/issues)[4 PRs](https://github.com/allansun/kubernetes-php-client/pulls)1MITPHPPHP &gt;=7.2

Since Jan 7Pushed 2y ago5 watchersCompare

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

READMEChangelogDependencies (9)Versions (648)Used By (1)

Kubernetes-PHP-Client (`kpc`)
=============================

[](#kubernetes-php-client-kpc)

[![Minimum PHP Version](https://camo.githubusercontent.com/82e6fcbc15be9a33ae9e68c9b8c33afbd05d9c3f5ad16631bc11249352748871/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344372e312d677265656e2e7376673f7374796c653d706c6173746963)](https://php.net/)[![Gitter](https://camo.githubusercontent.com/b611ca033b57694601aabfff8b0da5cd4ca53549ffa7dcdef56553b2b7a37aca/68747470733a2f2f6261646765732e6769747465722e696d2f616c6c616e73756e2f6b756265726e657465732d7068702d636c69656e742e7376673f7374796c653d706c6173746963)](https://gitter.im/allansun/kubernetes-php-client?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

This is a full PHP client reverse engineered from Kubernetes' Swagger defination.

You can control your Kubernetes cluster in PHP, the programmatical way.

Kubernetes Release Compatibility
--------------------------------

[](#kubernetes-release-compatibility)

### Kubernetes Version Support

[](#kubernetes-version-support)

Since this client is generated from Kubernetes' swagger file, it follows whatever the backward compatibilities Kubernetes has. You should use the correct version against your cluster.

One exception, in regards to compatibility, `kpc` supports the equivalent Kubernetes minor release number. A minor version is the second digit in the release number. `kpc` version 1.8.0 has a minor version of 8. The numbering follows the semantic versioning specification, MAJOR.MINOR.PATCH.

For example, `kpc` 1.8.0 does not support Kubernetes 1.9.2, but `kpc` 1.9.0 supports Kubernetes 1.9.2 and previous Kubernetes versions. Only when `kpc` minor version matches, the Kubernetes minor version does `kpc` officially support the Kubernetes release. `kpc` does not stop a user from using mismatching versions of K8s, but Kubernetes releases always require `kpc` to install specific versions of components like docker, that tested against the particular Kubernetes version.

`kpc` does not neccessarily follow the PATCH number of Kubernetes release. Each minor version is generated against latest minor version of Kubernetes lease.

### Compatibility Matrix

[](#compatibility-matrix)

kpc versionk8s 1.7.xk8s 1.8.xk8s 1.9.xk8s 1.10.xk8s 1.11.x1.11.xYYYYY1.10.xYYYYN1.9.xYYYNN1.8.xYYNNNUse the latest version of kpc for all releases of Kubernetes, with the caveat that higher versions of Kubernetes are not *officially* supported by kpc.

### kpc Release Schedule

[](#kpc-release-schedule)

This project runs on an automatic nightly build against latest Kubernetes release. If you found a particular version not available please open an issue so I can generate it manually.

Installation
------------

[](#installation)

Add a dependency on kubernetes/php-client to your project's `composer.json` by utilizing the \[Composer\] () package manager.

```
{
    "require-dev": {
        "kubernetes/php-client": "~{KUBERNETES_VERSION}"
    }
}
```

{KUBERNETES\_VERSION} should match at least the minor version of your Kubernetes cluster.

For example `"kubernetes/php-client": "~1.8"` should be used against Kubernetes version 1.8.x

Usage instruction
-----------------

[](#usage-instruction)

Now you need to configure authentication credentials via a static method, (you only need to do this once).

```
