PHPackages                             moonspot/kubernetes - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. moonspot/kubernetes

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

moonspot/kubernetes
===================

Library of classes for composing Kubernetes objects

v1.29.0(2y ago)06PHPPHP &gt;=8.0

Since Nov 1Pushed 2y ago1 watchersCompare

[ Source](https://github.com/brianlmoon/kubernetes)[ Packagist](https://packagist.org/packages/moonspot/kubernetes)[ RSS](/packages/moonspot-kubernetes/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (15)Used By (0)

Kubernetes Objects
==================

[](#kubernetes-objects)

This library builds, imports, and exports Kubernetes objects. The classes are all built using the Swagger files in the [kubernetes/kubernetes](https://github.com/kubernetes/kubernetes)repository.

The original purpose for building this library was for writing applications that interact with Kubernetes objects. It is not the intention that this library be used to build configuration management repositories. The PHP code for managing objects would likely be more verbose and complex than simply writing the needed YAML.

Version Compatibility
---------------------

[](#version-compatibility)

The versions of this library follow the major/minor release versions of the official Kubernetes releases. Only versions from 1.21 forward are supported.

Example
-------

[](#example)

```
$configmap = \Moonspot\Kubernetes\Kubernetes::new('ConfigMap');

$configmap->metadata->name = 'MyConfigMap';
$configmap->metadata->labels = [
    "app-name" => 'MyApp'
];
$configmap->data = [
    'config.ini' => "some_setting = 1\nsome_setting = 2\n"
];

echo $configmap->toYaml();
```

Result:

```
---
apiVersion: v1
data:
  config.ini: |
    some_setting = 1
    some_setting = 2
kind: ConfigMap
metadata:
  labels:
    app-name: MyApp
  name: MyConfigMap
...
```

Importing
---------

[](#importing)

The factory method of the Kubernetes class will auto-detect the kind of object and create it.

```
$configmap = \Moonspot\Kubernetes\Kubernetes::factory(file_get_contents('./configmap.yaml'));

echo $configmap->metadata->name . "\n";
```

Result:

```
MyConfigMap

```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~31 days

Recently: every ~102 days

Total

14

Last Release

884d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/49531?v=4)[Brian Moon](/maintainers/brianlmoon)[@brianlmoon](https://github.com/brianlmoon)

---

Top Contributors

[![brianlmoon](https://avatars.githubusercontent.com/u/49531?v=4)](https://github.com/brianlmoon "brianlmoon (20 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/moonspot-kubernetes/health.svg)

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

PHPackages © 2026

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