- How do I install krymosoftware/php-k8s in a Laravel application?
- Install it with Composer using composer require krymosoftware/php-k8s. It is a plain PHP library, so on Laravel 11+ you can autoload it without any package discovery step. Because the service provider and facade were removed in 3.9.0, any container binding or config file you want is application-owned code you write yourself. If you are not ready for that migration, pin the constraint to 3.8.* and upgrade deliberately.
- Does php-k8s still support Laravel?
- The core client is framework-agnostic, but the Laravel convenience layer (service provider, facade, and publishable config/k8s.php) was removed in 3.9.0. Laravel applications can still use the package by constructing the client manually and binding it in your own service provider, which is typically only tens of lines. Treat that binding as part of your application code, not as something the package maintains for you.
- Which PHP and Laravel versions does php-k8s 3.9.x support?
- The 3.9.0 release drops PHP 8.2 support, so the floor moves to PHP 8.3 or later, and it also removes the bundled Laravel integration. Because those are breaking changes shipped in a minor version, verify the actual require.php constraint in composer.json rather than assuming. Laravel itself is no longer declared as a dependency target, so any Laravel version compatibility is whatever your application's own binding code supports. Services still running PHP 8.2 cannot take 3.9.x at all and must stay on 3.8.x or upgrade PHP first.
- Why did my Laravel app fail to boot after a composer update to php-k8s 3.9.0?
- Version 3.9.0 removed the Laravel service provider and facade, so any app relying on package auto-discovery or referencing those classes will fail at bootstrap with missing class errors. This is a breaking change published in a minor release, so a routine composer update on a ^3.0 constraint can pull it in silently. Pin to 3.8.* immediately, then inventory your code for facade usage, config publishing, and container bindings before attempting the upgrade. Replace those with an application-owned service provider that builds the client yourself.
- How does php-k8s authenticate against a Kubernetes cluster?
- The client is designed to support any form of authentication, including kubeconfig files, in-cluster service account tokens, and the exec credential plugin flow. That makes it usable both inside a pod and from a developer machine or CI runner talking to a remote cluster. Configure credentials at client construction time and keep secrets out of source control. If you previously relied on the published config file for this, replicate those settings in your own config after moving to 3.9.x.
- How do I create and manage custom resources (CRDs) with php-k8s?
- Custom resource support is one of the package's stated strengths, with an easy implementation path for CRDs so you can model your own resource kinds without hand-writing raw request payloads. You define the resource's group, version, and kind and then use the client's normal create, get, update, and delete operations. This is the main reason to choose this package over a generic HTTP wrapper around the Kubernetes API.
- Can php-k8s exec into pods or stream logs?
- Yes, the exec API is explicitly supported, and the client handles the underlying WebSocket connection used for exec, attach, port-forward, and log streaming. Version 3.9.0 bumped ratchet/pawl, which is the only change touching long-lived connection behaviour, so validate reconnects, backoff, and error surfacing rather than treating it as a routine dependency refresh. That upgrade may also pull newer react/* versions that conflict with other WebSocket consumers in the same application. Smoke test streaming paths against a real cluster before rolling out.
- Are named parameters in KubernetesCluster functions a breaking change?
- It depends on whether parameter names were merely made addressable or actually renamed. Callers using positional arguments are almost certainly unaffected, while callers using named arguments will break if a name changed. Audit your call sites with a grep for named argument usage before upgrading. The same caution applies to resource creation timestamps, which are additive but may be null on older API servers, so guard against calling diffForHumans on a null value.
- Is php-k8s safe to use in production and is it well maintained?
- Functionally it is a reasonable choice for querying clusters, managing resources, and automating cluster operations from PHP, but the project is single-maintainer, which warrants an explicit exit plan. The 3.9.0 release shipped breaking changes in a minor version, so constrain versions tightly and review changelogs instead of relying on semver. Consider a 4.0.0 release to formally mark the removals and clarify whether 3.8.x will still receive security fixes. Keep a documented fallback for direct kubectl or HTTP API calls if the package stalls.
- What alternatives exist for talking to Kubernetes from PHP, and how do I test this client?
- The main alternatives are shelling out to kubectl, using a generic HTTP client against the Kubernetes REST API, or generating a client from the OpenAPI spec, none of which offer the CRD convenience this package does. For testing, mock the client at your application boundary rather than standing up a real cluster for every test, and use a disposable cluster such as kind or k3d for integration coverage of exec, log streaming, and CRD handling. Cover the upgrade specifically: assert that your service provider binds correctly and that your facade-free call sites still work.