๐Watching Resources
Watch Resource
The ability to watch the Pods logs is also available and can be seen in the Pod Documentation
The package comes with a PHP-native way to be able to track the changes via the Kubernetes cluster's Watch API.
You can watch the resource directly from the Resource class, and check & process your logic inside a closure. See more on Kubernetes Documentation.
Watching a specific resource
The watch closures will run indefinitely until you return a true
or false
within the closure.
For additional parameters like resourceVersion
, continue passing an array of query parameters alongside the closure:
Watching all resources
To watch all resources instead of just one, you may call watchAll
. This time, you do not need to call any filter or retrieval, because there is nothing to filter:
Last updated