appwrite-labs/php-k8s 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

appwrite-labs/php-k8s

Composer 安装命令:

composer require appwrite-labs/php-k8s

包简介

Control your Kubernetes clusters with this PHP-based Kubernetes client. It supports any form of authentication, the exec API, and it has an easy implementation for CRDs.

README 文档

README

Note: This is a maintained fork of renoki-co/php-k8s with PHP 8.3+ support and additional features. See fork differences for details.

v1.33.10 K8s Version v1.34.6 K8s Version v1.35.3 K8s Version

Client Capabilities Client Support Level

Control your Kubernetes clusters with this PHP-based Kubernetes client. It supports any form of authentication, the exec API, and it has an easy implementation for CRDs.

For Laravel projects, you might want to use renoki-co/laravel-php-k8s (from the upstream project). Note that compatibility with this fork is not guaranteed.

✨ Features

  • Full Kubernetes API Support: 33+ resource types including Pods, Deployments, Services, and more
  • Exec & Logs: Execute commands and stream logs from containers
  • Watch API: Real-time event streaming for resource changes
  • JSON Patch & Merge Patch: RFC 6902 and RFC 7396 support for precise updates
  • Custom Resources (CRDs): Easy CRD integration with macros
  • PHP 8.2+ Modern Features: Enums, type hints, readonly properties, match expressions
  • Laravel Integration: First-class Laravel support via laravel-php-k8s
  • Flexible Authentication: Kubeconfig, tokens, certificates, exec plugins, AWS EKS native, OpenShift OAuth
  • YAML Import: Load resources directly from YAML files with templating

🚀 Quick Start

use RenokiCo\PhpK8s\K8s;
use RenokiCo\PhpK8s\KubernetesCluster;

$cluster = new KubernetesCluster('http://127.0.0.1:8080');

$pod = K8s::pod($cluster)
    ->setName('my-pod')
    ->setContainers([
        K8s::container()->setName('app')->setImage('nginx:latest')
    ])
    ->create();

echo $pod->getName(); // my-pod
echo $pod->getPodPhase(); // Returns PodPhase enum

See more examples →

🔐 Advanced Authentication

AWS EKS Native

// No AWS CLI required - pure PHP token generation
$cluster = KubernetesCluster::fromUrl($eksClusterUrl)
    ->withEksAuth('cluster-name', 'us-east-2')
    ->withCaCertificate('/path/to/ca.crt');

OpenShift OAuth

// Direct username/password authentication
$cluster = KubernetesCluster::fromUrl($openshiftUrl)
    ->withOpenShiftAuth('username', 'password');

Exec Credential Plugins

// Automatically supported from kubeconfig
$cluster = KubernetesCluster::fromKubeConfigYamlFile('~/.kube/config');
// Works with AWS EKS, GKE, AKS, and custom credential providers

See authentication docs →

📦 Requirements

  • PHP 8.2 or higher
  • Laravel 11.x or 12.x (for Laravel integration)
  • Kubernetes cluster access

📃 Documentation

Read the full documentation at php-k8s.cuppett.dev

This fork is based on renoki-co/php-k8s. See the project history and upstream documentation for more details.

🐛 Testing

vendor/bin/phpunit

🤝 Contributing

Please see CONTRIBUTING for details.

🔒 Security

If you discover any security related issues, please email steve@cuppett.com instead of using the issue tracker.

🎉 Credits

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2026-06-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固