k8s / http-symfony
Symfony based HttpClient factory for k8s/client
1.1.0
2022-06-20 15:14 UTC
Requires
- php: >=7.2
- k8s/core: ^1.3
- nyholm/psr7: ^1.0
- psr/http-client: ^1.0
- symfony/http-client: >=4.3
Requires (Dev)
- ext-mbstring: *
- friendsofphp/php-cs-fixer: ^2.0
- mockery/mockery: ~1.3.0
- phpstan/phpstan: ^0.12
- phpunit/phpunit: ^8.0
README
This library provides a Symfony based HttpClient factory for the k8s/client
library.
General Use with the K8s library / Configuration Options
- Install the library:
composer require k8s/http-symfony
- Construct the main client for
k8s/client
through theK8sFactory
:
use K8s\Client\K8sFactory; # Load the client from the default KubeConfig $k8s = (new K8sFactory())->loadFromKubeConfig();
Your new client will have all the HttpClient options needed pre-populated when used.
Default HTTP Options Configuration
To specify extra defaults for the Symfony HTTP client, you can construct it like this:
use K8s\HttpSymfony\ClientFactory; use K8s\Client\K8sFactory; # Pass any Symfony HTTP client options here. # The below would allow for self-signed certificates. $httpFactory = new ClientFactory([ 'verify_peer' => false, 'verify_host' => false, ]); $k8s = (new K8sFactory())->loadFromKubeConfig(null, $httpFactory);