Course Name:- Kubernetes Operators Advanced
Module 1. Reconciliation Loops
Question 1. What are the results that can be returned from a single iteration of a reconcile loop?
- Requeue, Exit without requeuing
- Return and requeue, Return an error and requeue, Exit without requeuing
- Exit, Exit with error
- Return and requeue, Return an error, Exit without requeuing
Question 2. The reconciliation loop is where the actual behavior of an operator is defined.
- True
- False
Question 3. Why is it a good idea to build a reconciliation loop out of small, iterative steps?
- The desired state of the cluster can change during reconciliation
- The actual state of the cluster can change during reconciliation
- The reconciliation request might be picked up by multiple controllers
- All of the above
Question 4. What do the Kubebuilder markers we put above the Reconcile method declaration do?
- The reconciliation request might be picked up by multiple controllers
- Create the RBAC for the controller to access the specified resources
- Scaffold the custom resource types for the operator
- Scaffold the reconcile loops for the specified resource
Question 5. It is possible for the object you are reconciling to no longer exist by the time the request is being processed.
- True
- False
Module 2. Operator lifecycle Manager
Practice Quiz
Question 1. Operator developers are expected to understand how OLM works to install their own operator bundles.
- True
- False
Question 2. What information is contained in the bundle’s manifests?
- Kubernetes yaml files for installing OLM
- Kubernetes yaml files that contain the resources that make up the operator
- Manifests for creating the operator container image
- Manifests for creating the bundle container image
Question 3. Multiple API versions of a resource can exist a cluster simultaneously.
- True
- False
Reveiw Question
Question 1. What are the three main components of a bundle?
- Sample, Config, and Image
- Manifests, Metadata, and a Dockerfile
- Config, an Operator image, and a bundle image
- Data, Metadata, and a Dockerfile
Question 2. A conversion webhook is a special kind of admission webhook.
- True
- False
Question 3. Why is it important to include a conversion webhook when upgrading the API version of an operator?
- To convert running instances to the new version of Memcached
- To migrate requests from users and controllers to the new version
- To migrate the database records to the new version
- To convert pre-existing instances of the resource to the new version
Question 4. Kubernetes conversion logic is based on what kind of model?
- Many to Many
- Hub and Spoke
- Up and Down
- Wheel and Deal
Question 5. Although the underlying custom resources that OLM uses may change, the format of an operator bundle should stay the same moving forward.
- True
- False
Module 3. Scorecard
Practice Quiz
Question 1. Custom Scorecard test suites are provided as container images.
- True
- False
Question 2. Your bundle starts with some automatically generated Scorecard tests that test what features of your operator?
- Regression tests to test upgrading your operator
- Basic best practices like descriptors and validators for your custom resource types
- Benchmarks to stress-test your operator
- Basic unit tests that test your custom resource types
Question 3. Custom Scorecard test suites can contain multiple tests.
- True
- False
Review Questions
Question 1. In the config file, each Scorecard test consists of what three components?
- Operator image, Test image, Test command
- Image, Entrypoint, Labels
- Test file, Commands, Bundle
- Dockerfile, Entrypoint, Name
Question 2. Scorecard tests execute from your local machine targeting the cluster.
- True
- False
Question 3. Why did we have to cross compile our Scorecard test?
- To include our Scorecard config
- It’s executed in a container on the cluter, which is a 64-bit Linux environment
- To include our operator’s bundle
- To ensure all the dependencies were included
Question 4. Why did we run our Scorecard test with our operator’s Service Account?
- To give Scorecard the RBAC permissions to run the test container
- To give it the RBAC permissions needed to manipulate the Memcached and dependant types
- To give it the RBAC permissions to manipulate our operator’s controller
- To tell it which operator to test
Question 5. The Scorecard config is part of your operator’s bundle.
- True
- False
Kubernetes Operators Advanced Cognitive Class Final Exam Answers:-
Question 1. Your Scorecard config is automatically generated as part of your operator’s bundle.
- True
- False
Question 2. Why is it important to include a conversion webhook when upgrading the API version of an operator?
- To convert running instances to the new version of Memcached
- To migrate requests from users and controllers to the new version
- To migrate the database records to the new version
- To convert pre-existing instances of the resource to the new version
Question 3. Your bundle starts with some automatically generated Scorecard tests that test what features of your operator?
- Regression tests to test upgrading your operator
- Basic best practices like descriptors and validators for your custom resource types
- Benchmarks to stress-test your operator
- Basic unit tests that test your custom resource types
Question 4. What are the results that can be returned from a single iteration of a reconcile loop?
- Requeue, Exit without requeuing
- Return and requeue, Return an error and requeue, Exit without requeuing
- Exit, Exit with error
- Return and requeue, Return an error, Exit without requeuing
Question 5. Conversion between different API versions of the same resource is based on a Hub-and-Spoke model.
- True
- False
Question 6. Why should you start a reconciliation loop by fetching the object you’re reconciling?
- To get the most recent API version of the object
- The object may have been deleted, updated, or otherwise invalidated in the meantime
- To fetch the object’s schema
- The object object isn’t included in the reconciliation request
Question 7. A conversion webhook is a special type of which kind of default Kubernetes resource?
- Controller webhook
- Mutating webhook
- Upgrade webhook
- Admission webhook
Question 8. Why is it a good idea to build a reconciliation loop out of small, iterative steps?
- The desired state of the cluster can change during reconciliation
- The actual state of the cluster can change during reconciliation
- The reconciliation request might be picked up by multiple controllers
- All of the above
Question 9. What are the three main components of a bundle?
- Sample, Config, and Image
- Manifests, Metadata, and a Dockerfile
- Config, an Operator image, and a bundle image
- Data, Metadata, and a Dockerfile
Question 10. A Scorecard test requires a Service Account with permissions to access your custom resource types.
- True
- False