Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the command to create a resource from a file.
Kubernetes
kubectl [1] -f resource.yaml Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'apply' instead of 'create' when creating a new resource.
✗ Incorrect
The kubectl create command creates a new resource from the file.
2fill in blank
mediumComplete the command to update or create a resource from a file.
Kubernetes
kubectl [1] -f resource.yaml Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'create' which fails if resource exists.
✗ Incorrect
The kubectl apply command updates the resource if it exists or creates it if it does not.
3fill in blank
hardFix the error in the command to update a resource using a file.
Kubernetes
kubectl [1] -f resource.yaml Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'create' which causes error if resource exists.
✗ Incorrect
To update a resource from a file, kubectl apply is the correct command.
4fill in blank
hardFill both blanks to create a resource and then update it.
Kubernetes
kubectl [1] -f resource.yaml kubectl [2] -f resource.yaml
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'apply' first which works but is not typical for initial creation.
✗ Incorrect
First, use create to make the resource. Then use apply to update it.
5fill in blank
hardFill all three blanks to explain the difference between create and apply.
Kubernetes
kubectl [1] creates a resource and fails if it [2]. kubectl [3] updates or creates the resource.
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing 'delete' with 'create' or 'apply'.
✗ Incorrect
kubectl create makes a resource but fails if it exists. kubectl apply updates or creates the resource.