Scale Deployment and Expose via NodePort Service
Scenario
An existing ecommerce-frontend-deployment Deployment is running in the ecommerce-platform namespace with 2 replicas.
The application runs on port 80 inside the containers and serves content from the ecommerce-frontend-config ConfigMap.
Your task is to:
- Scale the
ecommerce-frontend-deploymentto 5 replicas to handle increased traffic - Add the label
role: webfrontendto the pod template metadata - Create a NodePort Service named
ecommerce-frontend-servicethat:- Exposes the application on TCP port 8000
- Uses the deployment's existing selector labels
# Test the service (replace <NodePort> with actual port)
curl http://cplane-01:<NodePort>