Watching Resources
Last updated
Was this helpful?
Last updated
Was this helpful?
The ability to watch the Pods logs is also available and can be seen in the
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 .
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:
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: