---
title: "Installation — Kubernetes API for Laravel | Roundly"
description: "Install via Composer, optionally publish config/kubernetes.php, and let auto-discovery register the provider and the Kubernetes facade."
url: https://roundly-consulting.com/open-source/docs/kubernetes-api-for-laravel/installation
language: en
---

[All packages](https://roundly-consulting.com/open-source.md)

[Kubernetes API for Laravel](https://roundly-consulting.com/open-source/docs/kubernetes-api-for-laravel.md)

# Installation

Require the package with Composer. The service provider and the Kubernetes facade alias are auto-discovered — no manual registration:

```bash
composer require roundly-consulting/kubernetes-api-for-laravel
```

Publishing the config is optional — the package works with zero configuration: set KUBERNETES\_URL and KUBERNETES\_TOKEN for a single cluster, add more under clusters, or define clusters in code. The default resource map ships built in. Publish the config to add clusters or tune rate limits, HTTP client options, the Traefik API group or the resource map:

```bash
php artisan vendor:publish --tag="kubernetes-config"
```

kubernetes-config is the only publish tag. There are no migrations, views or routes — the package is a pure HTTP client. The provider binds KubernetesManager as a container singleton (the facade root), adds the kubernetes:ping command and contributes a Kubernetes section to php artisan about.

## Your first request

Point the default cluster at your apiserver through the environment:

```bash
KUBERNETES_URL=https://api.my-cluster.example:6443
KUBERNETES_TOKEN=service-account-token
```

Then list a namespace’s deployments through the facade:

```php
use RoundlyConsulting\KubernetesApi\Facades\Kubernetes;

Kubernetes::ping(); // true when the apiserver answers

foreach (Kubernetes::namespace('shop')->deployments()->get() as $deployment) {
    echo $deployment->getName().': '.$deployment->getReadyReplicasCount().' ready'.PHP_EOL;
}
```

## Show your open-source love

This package is free and MIT-licensed. If it saves you time, a one-off donation or a Patreon membership keeps it maintained, tested and documented.

[More ways to support, including crypto](https://roundly-consulting.com/support-us.md)

By donating, you agree to our [donation terms](https://roundly-consulting.com/donation-terms.md).

[Support our open source work (opens in a new tab)](https://donate.stripe.com/dRmeVe8FX5PF1Qd9pXcEw00) [Join us on Patreon (opens in a new tab)](https://www.patreon.com/cw/roundly)

## Want this built into your product?

We integrate our packages into custom Laravel and AI builds. Tell us what you're working on and we'll reply within 48 hours.

[Get a quote in 48 hours](https://roundly-consulting.com/contact.md) [Browse all packages](https://roundly-consulting.com/open-source/docs/kubernetes-api-for-laravel.md)
