You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This library provides a Swoole based websocket adapter for the k8s/client library.
General Use with the K8s library / Configuration Options
Install the library:
composer require k8s/ws-swoole
Note: If you don't need to change any TLS settings, this is all that is needed most likely.
If you need to configure any options, then you can use the below method to set those and use the websocket with them:
useK8s\Client\K8s;
useK8s\Client\Options;
useK8s\WsSwoole\CoroutineAdapter;
$options = [
# May need to toggle SSL verification settings if using a self-signed cert, like for Minikube'ssl_allow_self_signed' => true,
'ssl_verify_peer' => false,
'verify_peer' => false,
'verify_peer_name' => false,
# To use certificate based auth, you may need to pass in the cert locations.'ssl_cert_file' => '<home-dir>/.minikube/profiles/minikube/client.crt',
'ssl_key_file' => '/<home-dir>/.minikube/profiles/minikube/client.key',
];
$websocket = newCoroutineAdapter($options);
# You can then pass the new websocket adapter in the options to be used$options = newOptions('k8s.endpoint.local');
$options->setWebsocketClient($websocket);
# Construct K8s to use the new websocket in the options$k8s = newK8s($options);
About
A Swoole based weboscket adapter for the k8s-client.