Managing Operators Flashcards
Check the list of available operators
oc get packagemanifests
Inspect an operator
oc describe packagemanifests file-integrity-operator
Get an operator version
oc get packagemanifests file-integrity-operator
–output=’jsonpath={range .status.channels[*]}{.name}{“\n”}{end}’
get list of installed operators across namespaces
oc get csv -A
list the operators managed by the OLM
oc get subs -A
Namespace CR for operator creation
Operators that are installed using the OLM require a group that matches the namespace name. True or False?
True
CR to create a group for the operator
CR to create an operator sub
Steps to create an operator
1) Create namespace with: openshift.io/cluster-monitoring: “true”
2) Create an operator group
3) Create a subscription object
Check the logs of the OLM pod to verify operator installation
oc logs pod/olm-operator-c5599dfd7-nknfx \
-n openshift-operator-lifecycle-manager
Inspect the subscription object to verify the operator status
oc describe sub <subscription-name> -n <namespace></namespace></subscription-name>
Deleting Operator
1) oc delete sub <subscription-name>
2) oc get sub <subscription-name> -o yaml | grep currentCSV
3) oc delete csv <currentCSV></currentCSV></subscription-name></subscription-name>
view events and logs of an operator
oc logs deployment.apps/file-integrity-operator
get all objects related to an operator
oc get all -n openshift-file-integrity