Complete the command to add a label to a pod named 'my-pod'.
kubectl label pods my-pod [1] env=productionThe --overwrite flag allows updating an existing label on the resource.
Complete the YAML snippet to add a label 'app: web' to a deployment.
metadata:
labels:
[1]: webThe label key app is commonly used to identify the application name.
Fix the error in the command to label a node named 'node1' with 'role=worker'.
kubectl label nodes node1 [1] role=workerThe --overwrite flag is required to change an existing label on a node.
Fill both blanks to add label 'env=prod' to a service named 'backend'.
kubectl label service backend [1] [2]
The --overwrite flag allows updating existing labels. Then the label env=prod is added.
Fill all three blanks to create a pod YAML with labels 'app: frontend' and 'env: staging'.
apiVersion: v1
kind: Pod
metadata:
name: my-pod
labels:
[1]: [2]
[3]: stagingThe labels are key-value pairs. Here, app: frontend and env: staging are set.
