Skip to content

Instantly share code, notes, and snippets.

@pweil-
Created October 4, 2018 14:44
Show Gist options
  • Save pweil-/2e7f3259d9fe228cd2a71cb9c7117673 to your computer and use it in GitHub Desktop.
Save pweil-/2e7f3259d9fe228cd2a71cb9c7117673 to your computer and use it in GitHub Desktop.
[pweil@pweil-fedora origin]$ oc observe --help
Observe changes to resources and take action on them
This command assists in building scripted reactions to changes that occur in Kubernetes or OpenShift resources. This is
frequently referred to as a 'controller' in Kubernetes and acts to ensure particular conditions are maintained. On
startup, observe will list all of the resources of a particular type and execute the provided script on each one.
Observe watches the server for changes, and will reexecute the script for each update.
Observe works best for problems of the form "for every resource X, make sure Y is true". Some examples of ways observe
can be used include:
* Ensure every namespace has a quota or limit range object
* Ensure every service is registered in DNS by making calls to a DNS API
* Send an email alert whenever a node reports 'NotReady'
* Watch for the 'FailedScheduling' event and write an IRC message
* Dynamically provision persistent volumes when a new PVC is created
* Delete pods that have reached successful completion after a period of time.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment