Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .claude/agents/integration-test-runner.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ You are an elite Integration Test Engineer specializing in Kubernetes client lib
minikube stop
minikube delete
```
4. Start fresh minikube cluster matching CI configuration (currently v1.37.0 with Kubernetes versions v1.32.9, v1.33.5, or v1.34.1)
4. Start fresh minikube cluster matching CI configuration (currently v1.37.0 with Kubernetes versions v1.33.10, v1.34.6, or v1.35.3)
5. Install required addons:
- volumesnapshots
- csi-hostpath-driver
Expand Down Expand Up @@ -84,8 +84,8 @@ Provide detailed, actionable reports:

Environment:
- Minikube: v1.37.0
- Kubernetes: v1.33.5
- PHP: 8.2
- Kubernetes: v1.34.6
- PHP: 8.3
- Test Duration: 12m 34s

Results:
Expand Down
43 changes: 6 additions & 37 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,46 +21,15 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['8.2', '8.3', '8.4']
kubernetes: ['1.32.9', '1.33.5', '1.34.1']
laravel: ['11.*', '12.*']
php: ['8.3', '8.4', '8.5']
kubernetes: ['1.33.10', '1.34.6', '1.35.3']
laravel: ['12.*', '13.*']
prefer: [prefer-lowest, prefer-stable]
include:
- laravel: "11.*"
testbench: "9.*"
- laravel: "12.*"
testbench: "10.*"
# PHP 8.5 only for Laravel 12
- php: '8.5'
kubernetes: '1.32.9'
laravel: '12.*'
testbench: "10.*"
prefer: prefer-lowest
- php: '8.5'
kubernetes: '1.32.9'
laravel: '12.*'
testbench: "10.*"
prefer: prefer-stable
- php: '8.5'
kubernetes: '1.33.5'
laravel: '12.*'
testbench: "10.*"
prefer: prefer-lowest
- php: '8.5'
kubernetes: '1.33.5'
laravel: '12.*'
testbench: "10.*"
prefer: prefer-stable
- php: '8.5'
kubernetes: '1.34.1'
laravel: '12.*'
testbench: "10.*"
prefer: prefer-lowest
- php: '8.5'
kubernetes: '1.34.1'
laravel: '12.*'
testbench: "10.*"
prefer: prefer-stable
- laravel: "13.*"
testbench: "11.*"

name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - K8s v${{ matrix.kubernetes }} --${{ matrix.prefer }}

Expand Down Expand Up @@ -99,7 +68,7 @@ jobs:
- uses: medyagh/setup-minikube@latest
name: Setup Minikube
with:
minikube-version: 1.37.0
minikube-version: 1.38.1
driver: docker
container-runtime: containerd
kubernetes-version: v${{ matrix.kubernetes }}
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/docs-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ on:
- '.github/workflows/docs-deploy.yml'
- 'package.json'
- 'package-lock.json'
pull_request:
branches: [main]
paths:
- 'docs/**'
- 'package.json'
- 'package-lock.json'
workflow_dispatch:

jobs:
Expand Down
6 changes: 3 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Pint auto-fixes:
3. Commit and push fixes

## Stack & Requirements
- **PHP:** `^8.2` (CI also exercises 8.5).
- **PHP:** `^8.3` (CI also exercises 8.5).
- **Composer deps:** Guzzle 7, Symfony Process 7.3, Illuminate components, Ratchet Pawl, ext‑json; optional `ext-yaml` for YAML helpers, optional `aws/aws-sdk-php` for native EKS authentication.
- **Static analysis:** Psalm (see `psalm.xml`).
- **License:** Apache‑2.0.
Expand All @@ -59,7 +59,7 @@ Pint auto-fixes:

## Running Full Integration Tests Locally
These hit a live Kubernetes cluster and mirror CI.
- **Start cluster:** Minikube is the reference. Example: `minikube start --kubernetes-version=v1.33.1`.
- **Start cluster:** Minikube is the reference. Example: `minikube start --kubernetes-version=v1.34.6`.
- **Enable addons:** `minikube addons enable volumesnapshots && minikube addons enable csi-hostpath-driver && minikube addons enable metrics-server`.
- **Install VPA:** Clone `kubernetes/autoscaler` and run `./vertical-pod-autoscaler/hack/vpa-up.sh`. Alternatively:
```bash
Expand Down Expand Up @@ -233,7 +233,7 @@ These hit a live Kubernetes cluster and mirror CI.
7. Create PR against `cuppett/php-k8s` main branch: `gh pr create --repo cuppett/php-k8s --base main --title "..." --body "..."`

## Releasing & CI (Reference)
- CI matrix runs PHP 8.2-8.5 across Kubernetes v1.32.9, v1.33.5, v1.34.1 and Laravel 11/12 with both `prefer-lowest` and `prefer-stable`.
- CI matrix runs PHP 8.3-8.5 across Kubernetes v1.33.10, v1.34.6, v1.35.3 and Laravel 12/13 with both `prefer-lowest` and `prefer-stable`.
- Minikube v1.37.0 is provisioned in CI with VolumeSnapshots, CSI hostpath, metrics‑server, VPA, Sealed Secrets CRD, and Gateway API CRDs before running tests.
- Timeout: 25 minutes per job.

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
PHP K8s
=======

> **Note:** This is a maintained fork of [renoki-co/php-k8s](https://github.com/renoki-co/php-k8s) with PHP 8.2+ support and additional features. See [fork differences](https://php-k8s.cuppett.dev/project/fork-differences.html) for details.
> **Note:** This is a maintained fork of [renoki-co/php-k8s](https://github.com/renoki-co/php-k8s) with PHP 8.3+ support and additional features. See [fork differences](https://php-k8s.cuppett.dev/project/fork-differences.html) for details.

![v1.32.9 K8s Version](https://img.shields.io/badge/K8s%20v1.32.9-Ready-%23326ce5?colorA=306CE8&colorB=green)
![v1.33.5 K8s Version](https://img.shields.io/badge/K8s%20v1.33.5-Ready-%23326ce5?colorA=306CE8&colorB=green)
![v1.34.1 K8s Version](https://img.shields.io/badge/K8s%20v1.34.1-Ready-%23326ce5?colorA=306CE8&colorB=green)
![v1.33.10 K8s Version](https://img.shields.io/badge/K8s%20v1.33.10-Ready-%23326ce5?colorA=306CE8&colorB=green)
![v1.34.6 K8s Version](https://img.shields.io/badge/K8s%20v1.34.6-Ready-%23326ce5?colorA=306CE8&colorB=green)
![v1.35.3 K8s Version](https://img.shields.io/badge/K8s%20v1.35.3-Ready-%23326ce5?colorA=306CE8&colorB=green)

[![Client Capabilities](https://img.shields.io/badge/Kubernetes%20Client-Silver-blue.svg?colorB=C0C0C0&colorA=306CE8)](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/csi-new-client-library-procedure.md#client-capabilities)
[![Client Support Level](https://img.shields.io/badge/Kubernetes%20Client-stable-green.svg?colorA=306CE8)](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/csi-new-client-library-procedure.md#client-support-level)
Expand Down
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@
}
],
"require": {
"php": "^8.2",
"php": "^8.3",
"ext-json": "*",
"composer/semver": "^3.4",
"guzzlehttp/guzzle": "^7.10",
"illuminate/macroable": "^11.0|^12.0",
"illuminate/support": "^11.0|^12.0",
"illuminate/macroable": "^12.0|^13.0",
"illuminate/support": "^12.0|^13.0",
"ratchet/pawl": "^0.4.1",
"symfony/process": "^7.3.4"
"symfony/process": "^7.3.4|^8.0"
},
"suggest": {
"ext-yaml": "YAML extension is used to read or generate YAML from PHP K8s internal classes.",
Expand All @@ -59,8 +59,8 @@
"require-dev": {
"laravel/pint": "dev-main",
"mockery/mockery": "^1.6",
"orchestra/testbench": "^10.9.0",
"phpunit/phpunit": "^10.0|^11.5",
"orchestra/testbench": "^10.9.0|^11.0",
"phpunit/phpunit": "^11.5",
"vimeo/psalm": "^6.16.1"
},
"config": {
Expand Down
2 changes: 1 addition & 1 deletion docs/.vitepress/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ export default defineConfig({
collapsed: true,
items: [
{ text: 'Upstream to Fork', link: '/development/migration/upstream-to-fork' },
{ text: 'PHP 8.2+ Modernization', link: '/development/migration/php-82-modernization' },
{ text: 'PHP 8.3+ Modernization', link: '/development/migration/php-83-modernization' },
{ text: 'Version Upgrades', link: '/development/migration/version-upgrades' },
{ text: 'Breaking Changes', link: '/development/migration/breaking-changes' }
]
Expand Down
2 changes: 1 addition & 1 deletion docs/development/api-reference/enums/enumerations.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ $phaseString = $phase->value; // "Running" string

## See Also

- [PHP 8.2+ Modernization](/development/migration/php-82-modernization) - Enum usage guide
- [PHP 8.3+ Modernization](/development/migration/php-83-modernization) - Enum usage guide

---

Expand Down
2 changes: 1 addition & 1 deletion docs/development/contributing/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ vendor/bin/psalm
## Code Style

- Follow PSR-12
- Use PHP 8.2+ features (enums, type hints, match expressions)
- Use PHP 8.3+ features (enums, type hints, match expressions, typed class constants)
- Add type hints to all parameters and return types
- Write tests for new features

Expand Down
2 changes: 1 addition & 1 deletion docs/development/contributing/minikube-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Detailed Minikube configuration for PHP K8s development.
# See https://minikube.sigs.k8s.io/docs/start/

# Start cluster
minikube start --kubernetes-version=v1.33.1
minikube start --kubernetes-version=v1.34.6
```

## Enable Addons
Expand Down
6 changes: 3 additions & 3 deletions docs/development/contributing/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Set up your local development environment for contributing to PHP K8s.

## Prerequisites

- PHP 8.2 or higher (8.3+ recommended)
- PHP 8.3 or higher (8.4+ recommended)
- Composer
- Git
- Kubernetes cluster (Minikube recommended for development)
Expand All @@ -29,7 +29,7 @@ composer install

```bash
# Start with specific Kubernetes version
minikube start --kubernetes-version=v1.33.1
minikube start --kubernetes-version=v1.34.6

# Enable required addons
minikube addons enable volumesnapshots
Expand Down Expand Up @@ -115,7 +115,7 @@ StyleCI handles formatting in CI. Follow existing code patterns:

- PSR-12 coding standard
- Type hints on all parameters and return types
- Use PHP 8.2+ features (enums, readonly, match)
- Use PHP 8.3+ features (enums, readonly, match, typed class constants)

## Project Structure

Expand Down
2 changes: 1 addition & 1 deletion docs/development/integrations/ci-cd.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
php-version: '8.3'

- name: Install dependencies
run: composer install
Expand Down
6 changes: 3 additions & 3 deletions docs/development/migration/breaking-changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ This page documents all breaking changes in the fork compared to upstream.

## PHP Version Requirement

**Breaking:** Minimum PHP version is now 8.2
**Breaking:** Minimum PHP version is now 8.3

```php
// composer.json
{
"require": {
"php": "^8.2" // Was ^8.0 in upstream
"php": "^8.3" // Was ^8.0 in upstream
}
}
```
Expand Down Expand Up @@ -55,7 +55,7 @@ See the [Upstream to Fork Migration Guide](/development/migration/upstream-to-fo
## See Also

- [Fork Differences](/project/fork-differences) - Complete comparison
- [PHP 8.2+ Modernization](/development/migration/php-82-modernization) - Modern PHP features
- [PHP 8.3+ Modernization](/development/migration/php-83-modernization) - Modern PHP features

---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# PHP 8.2+ Modernization
# PHP 8.3+ Modernization

This fork leverages PHP 8.2+ features for improved type safety, performance, and developer experience.
This fork leverages PHP 8.3+ features for improved type safety, performance, and developer experience.

## PHP 8.2+ Features Used
## PHP 8.3+ Features Used

### Enumerations (Enums)

Expand Down Expand Up @@ -46,6 +46,50 @@ $action = match ($pod->getPodPhase()) {
};
```

### Typed Class Constants (PHP 8.3)

PHP 8.3 adds support for typed constants in classes and interfaces:

```php
class K8sResource
{
public const string DEFAULT_NAMESPACE = 'default';
public const int DEFAULT_REPLICAS = 1;
}
```

### #[\Override] Attribute (PHP 8.3)

Explicitly mark methods that override a parent method, catching typos at compile time:

```php
class K8sPod extends K8sResource
{
#[\Override]
public function toArray(): array
{
// ...
}
}
```

### json_validate() (PHP 8.3)

Validate JSON without decoding it:

```php
// Before
$decoded = json_decode($json);
if (json_last_error() !== JSON_ERROR_NONE) {
throw new \InvalidArgumentException('Invalid JSON');
}

// After (PHP 8.3)
if (! json_validate($json)) {
throw new \InvalidArgumentException('Invalid JSON');
}
```

### Nullable Types & Union Types

Better type safety:
Expand Down Expand Up @@ -374,6 +418,16 @@ if ($pod->getPodPhase() === 'Running') {
}
```

5. **Use typed class constants** (PHP 8.3):
```php
class ApiVersions
{
public const string APPS = 'apps/v1';
public const string CORE = 'v1';
public const string NETWORKING = 'networking.k8s.io/v1';
}
```

## See Also

- [Upstream to Fork Migration](/development/migration/upstream-to-fork) - Migrating from upstream
Expand All @@ -382,4 +436,4 @@ if ($pod->getPodPhase() === 'Running') {

---

*PHP 8.2+ modernization guide for cuppett/php-k8s fork*
*PHP 8.3+ modernization guide for cuppett/php-k8s fork*
12 changes: 6 additions & 6 deletions docs/development/migration/upstream-to-fork.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ This guide helps you migrate from `renoki-co/php-k8s` (upstream) to `cuppett/php

Consider migrating if you:

- ✅ Are using or plan to use PHP 8.2+
- ✅ Are using or plan to use PHP 8.3+
- ✅ Want type-safe enums for Kubernetes states
- ✅ Need the latest Kubernetes version support
- ✅ Value comprehensive documentation
- ✅ Want active maintenance and updates

Stay with upstream if you:

- ❌ Need PHP 8.0 or 8.1 support
- ❌ Need PHP 8.0, 8.1, or 8.2 support
- ❌ Prefer string-based status values
- ❌ Have deeply integrated with upstream-specific features
- ❌ Want the "official" package from the original author

## Prerequisites

- PHP 8.2 or higher installed
- PHP 8.3 or higher installed
- Composer
- Existing project using `renoki-co/php-k8s`

Expand All @@ -43,12 +43,12 @@ The fork maintains the same package name for easier migration. Configure your co

### 2. Update PHP Version

Ensure your project uses PHP 8.2+:
Ensure your project uses PHP 8.3+:

```json
{
"require": {
"php": "^8.2"
"php": "^8.3"
}
}
```
Expand Down Expand Up @@ -346,7 +346,7 @@ if ($pod->getPodPhase() === PodPhase::RUNNING) {
## Next Steps

- [Fork Differences](/project/fork-differences) - Detailed comparison
- [PHP 8.2+ Modernization](/development/migration/php-82-modernization) - Modern PHP features
- [PHP 8.3+ Modernization](/development/migration/php-83-modernization) - Modern PHP features
- [Examples](/examples/basic-crud) - See fork in action

---
Expand Down
Loading