A fluent, Eloquent-style client for the Kubernetes API in Laravel.
roundly-consulting/kubernetes-api-for-laravel is a Laravel package for a fluent, eloquent-style client for the kubernetes api in laravel..
It currently has 0 GitHub stars and 17 downloads on Packagist (latest version 1.2.2).
Install it with composer require roundly-consulting/kubernetes-api-for-laravel.
Discover more Laravel packages by roundly-consulting
or browse all Laravel packages to compare alternatives.
Last updated
A fluent, Eloquent-style client for the Kubernetes API in Laravel. Talk to one or many clusters through a chainable API built on Laravel's HTTP client, with the core Kubernetes resources, Traefik CRDs and your own custom resources built in.
Requires PHP 8.4, Laravel 12 or 13.
composer require roundly-consulting/kubernetes-api-for-laravel
Point it at your cluster with KUBERNETES_URL and KUBERNETES_TOKEN in .env.
List, create, scale and restart resources in one namespace of the default cluster:
use RoundlyConsulting\KubernetesApi\Facades\Kubernetes;
use RoundlyConsulting\KubernetesApi\Resources\Pod;
use RoundlyConsulting\KubernetesApi\Resources\Types\Container;
$shop = Kubernetes::namespace('shop'); // every request stays in `shop`
$pods = $shop->pods()->whereLabel('app', 'web')->get(); // a collection of Pod resources
$shop->deployments()
->setName('checkout')
->setReplicas(3)
->setPodsSelectors(['app' => 'checkout'])
->setTemplate(Pod::make()
->setLabels(['app' => 'checkout'])
->setContainers([Container::make()->setName('app')->setImage('nginx', '1.27-alpine')]))
->create();
$shop->deployments()->withName('checkout')->scale(5); // via the /scale subresource
$shop->deployments()->withName('checkout')->rolloutRestart(); // like `kubectl rollout restart`
Reach any other cluster the same way:
Kubernetes::cluster('production')->nodes()->get(); // a cluster from config/kubernetes.php
Kubernetes::fromKubeConfig(context: 'staging')->pods()->get(); // a kubeconfig context
Kubernetes::ping(); // does the apiserver answer?
The full documentation — configuration, every feature and its API, and testing — lives on our website: roundly-consulting.com/open-source/docs/kubernetes-api-for-laravel
Release notes are in CHANGELOG.md. To contribute, see the contributing guide.
This package is free and open source, built and maintained by Roundly Consulting. If it saves you time, please consider supporting our open-source work — a one-time donation, a monthly pledge on Patreon or a crypto donation helps fund maintenance, new features and new packages.
The MIT License (MIT). Please see License File for more information.