0
0
Kubernetesdevops~10 mins

Annotations vs labels in Kubernetes - Interactive Practice

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

Complete the code to add a label named env with value production to the pod metadata.

Kubernetes
metadata:
  labels:
    env: [1]
Drag options to blanks, or click blank then click option'
Aproduction
Bdev
Ctest
Dstaging
Attempts:
3 left
💡 Hint
Common Mistakes
Using annotations syntax instead of labels
Misspelling the key or value
2fill in blank
medium

Complete the code to add an annotation named description with value frontend pod to the pod metadata.

Kubernetes
metadata:
  annotations:
    description: [1]
Drag options to blanks, or click blank then click option'
Abackend pod
Bdatabase pod
Cfrontend pod
Dcache pod
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing annotations with labels
Using label syntax for annotations
3fill in blank
hard

Fix the error in the label selector to select pods with label tier equal to frontend.

Kubernetes
kubectl get pods -l tier=[1]
Drag options to blanks, or click blank then click option'
Afront-end
Bfrontend
Cfront_end
Dfront end
Attempts:
3 left
💡 Hint
Common Mistakes
Using spaces or underscores instead of exact label value
Incorrect casing
4fill in blank
hard

Fill both blanks to create a pod manifest with a label app set to nginx and an annotation maintainer set to team-a.

Kubernetes
metadata:
  labels:
    app: [1]
  annotations:
    maintainer: [2]
Drag options to blanks, or click blank then click option'
Anginx
Bteam-b
Cteam-a
Dapache
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping label and annotation values
Using wrong team names
5fill in blank
hard

Fill all three blanks to create a pod manifest with label role set to db, annotation backup set to daily, and label zone set to us-east.

Kubernetes
metadata:
  labels:
    role: [1]
    zone: [2]
  annotations:
    backup: [3]
Drag options to blanks, or click blank then click option'
Aweekly
Bus-east
Cdaily
Ddb
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing labels and annotations
Using wrong backup frequency