
Ultimate access to all questions.
Your team is aiming to use desired state configuration for your application deployed on a GKE cluster. You have YAML files for Kubernetes Deployment and Service objects. The application is designed to run with 2 pods, as specified by the replicas parameter in app-deployment.yaml. The service utilizes a GKE Load Balancer, defined in app-service.yaml. After creating the Kubernetes resources with kubectl apply -f app-deployment.yaml and kubectl apply -f app-service.yaml, the deployment is now live but experiencing performance issues. To address this, you decide to increase the number of replicas to 5. What is the correct approach to update the replicas in the existing Kubernetes deployment objects?
A
Ignore the YAML file and use the kubectl scale command to adjust the replicas to 5: kubectl scale --replicas=5 -f app-deployment.yaml.
B
Ignore the YAML file and enable autoscaling on the deployment based on CPU usage, setting the maximum pods to 5: kubectl autoscale myapp --max=5 --cpu-percent=80.
C
Use kubectl edit to modify the current deployment configuration directly, then save the changes: kubectl edit deployment/app-deployment -o yaml --save-config.
D
Update the number of replicas in the YAML file and reapply the configuration: kubectl apply -f app-deployment.yaml.