Skip to content
@p8p-client

p8p-client

P8P - PHP Client for Kubernetes

P8P is a PHP SDK for interacting with Kubernetes APIs. It automatically generates strongly-typed PHP classes from Kubernetes OpenAPI specifications.

📚 Documentation

Check out the complete documentation to get started with P8P.

📦 Packages

This project is organized as a monorepo. Each package is also available individually:

🚀 Quick Examples

Read pods

use P8p\Client\ClientFactory;
use P8p\Sdk\Api\Core\V1\PodApi;

$client = ClientFactory::fromUrl('http://127.0.0.1:8001')->getClient();

$podApi = $client->getApi(PodApi::class);
$pods = $podApi->list(namespace: 'default');

dd($pods->getContent())

Create pod

use P8p\Client\ClientFactory;
use P8p\Sdk\Api\Core\V1\PodApi;
use P8p\Sdk\Schema\Core\V1\Container;
use P8p\Sdk\Schema\Core\V1\Pod;
use P8p\Sdk\Schema\Core\V1\PodSpec;
use P8p\Sdk\Schema\Core\V1\ObjectMeta;

$client = ClientFactory::fromUrl('http://127.0.0.1:8001')->getClient();

$podApi = $client->getApi(PodApi::class);
$rs = $podApi->create('default', new Pod(
    metadata: new ObjectMeta(
        name: 'test-pod',
    ),
    spec: new PodSpec(
        containers: [
            new Container(
                name: 'nginx',
                image: 'nginx',
            ),
        ]
    )
));

dd($rs->getContent())

Pinned Loading

  1. p8p p8p Public

    PHP Kubernetes client SDK generator - Automatically generates strongly-typed PHP classes from Kubernetes OpenAPI specifications.

    PHP 6

  2. sdk sdk Public

    [Read only] Generated PHP classes representing Kubernetes resources (Pod, Service, Deployment, etc.) and their APIs. This package is entirely generated by CodeGenerator

    PHP 6

  3. generator generator Public

    [Read only] Code generator that reads Kubernetes OpenAPI v3 specifications and automatically produces PHP classes

    PHP 6

  4. client client Public

    [Read only] HTTP and Websocket client for communicating with Kubernetes APIs. Built with Symfony HttpClient and Serializer.

    PHP 6

Repositories

Showing 6 of 6 repositories

People

This organization has no public members. You must be a member to see who’s a part of this organization.

Top languages

Loading…

Most used topics

Loading…