0
0
Kubernetesdevops~10 mins

OperatorHub for community operators in Kubernetes - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the command to list all available community operators in OperatorHub.

Kubernetes
kubectl get [1] -n olm
Drag options to blanks, or click blank then click option'
Acatalogsources
Boperatorsources
Coperatorhub
Dpods
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'pods' instead of operator catalog resources.
Using 'operatorhub' which is not a kubectl resource.
Using 'operatorsources' which is deprecated.
2fill in blank
medium

Complete the command to install a community operator named 'etcd' from OperatorHub using OLM.

Kubernetes
kubectl create -f [1]
Drag options to blanks, or click blank then click option'
Aetcd-operator-subscription.yaml
Betcd-operator-pod.yaml
Cetcd-operator-crd.yaml
Detcd-operator-deployment.yaml
Attempts:
3 left
💡 Hint
Common Mistakes
Using deployment or pod YAML files instead of subscription.
Using CRD files which only define custom resources.
3fill in blank
hard

Fix the error in the command to approve the community operator's ClusterServiceVersion (CSV) named 'etcdoperator.v0.9.4'.

Kubernetes
kubectl patch csv etcdoperator.v0.9.4 -n operators [1] '{"spec":{"installPlanApproval":"Manual"}}'
Drag options to blanks, or click blank then click option'
Aupdate
Bpatch
Capply
Dedit
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'update' which is not a kubectl command.
Using 'edit' which opens an editor instead of applying a patch.
Using 'apply' which replaces the whole resource.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps operator names to their versions from a list of CSVs.

Kubernetes
{csv.metadata.name.split('-')[[1]]: csv.spec.version for csv in csv_list if csv.status.phase [2] 'Succeeded'}
Drag options to blanks, or click blank then click option'
A1
B0
C==
D!=
Attempts:
3 left
💡 Hint
Common Mistakes
Using index 0 which gives the first part, not the operator name.
Using '!=' which filters out succeeded operators.
5fill in blank
hard

Fill all three blanks to filter and map community operators with version greater than '1.0.0'.

Kubernetes
{csv.metadata.name.split('-')[[1]]: csv.spec.version for csv in csv_list if csv.spec.version [2] '1.0.0' and csv.status.phase [3] 'Succeeded'}
Drag options to blanks, or click blank then click option'
A1
B>
C==
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Using index 0 which is incorrect for operator name.
Using '<' or '==' for version comparison which does not filter correctly.
Using '!=' for phase which excludes succeeded operators.