Complete the code to create a Kubernetes deployment for a microservice.
kubectl create deployment [1] --image=myapp:latestThe deployment name should be a unique identifier for your microservice, such as 'my-microservice'.
Complete the command to expose the microservice deployment as a service.
kubectl expose deployment my-microservice --type=[1] --port=80
NodePort exposes the service on each Node's IP at a static port, making it accessible externally.
Fix the error in the YAML snippet to define a container image for the microservice.
containers:
- name: my-microservice
image: [1]The correct image format uses a colon ':' to separate the image name and tag, like 'myapp:latest'.
Fill both blanks to complete the YAML for a Kubernetes service selector.
selector: app: [1] tier: [2]
The selector matches pods labeled with app: my-microservice and tier: frontend to route traffic correctly.
Fill all three blanks to complete the command for scaling the deployment.
kubectl scale deployment [1] --replicas=[2] --namespace=[3]
This command scales the 'my-microservice' deployment to 5 replicas in the 'production' namespace.