
Explanation:
The correct answer is C because Kubernetes Deployments are managed through desired state configuration. To update the number of replicas, you should edit the replicas field in the YAML file and apply the changes using kubectl apply. This method ensures that your infrastructure's desired state is consistently maintained through configuration files.
kubectl scale bypasses the configuration file, which contradicts the team's goal of using desired state configuration.kubectl set image command is used for updating container images, not for adjusting the number of replicas.For more details, refer to the GCP documentation on Kubernetes Scaling Apps.
Ultimate access to all questions.
No comments yet.
Your team is excited about implementing desired state configuration for your infrastructure, particularly by storing Kubernetes Deployments in YAML. After creating a Kubernetes Deployment using the kubectl apply command with a YAML file, you now need to adjust the number of replicas. What is the correct approach to update the Deployment?
A
Use the kubectl scale command to immediately adjust the number of replicas.
B
Modify the number of replicas in the YAML file and push the changes to GitHub to trigger a deployment.
C
Update the number of replicas in the YAML file and rerun the kubectl apply command.
D
Change the number of replicas in the YAML file and execute the kubectl set image command.