Challenge, Easy,  on  Kubernetes

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:

  1. Scale the ecommerce-frontend-deployment to 5 replicas to handle increased traffic
  2. Add the label role: webfrontend to the pod template metadata
  3. Create a NodePort Service named ecommerce-frontend-service that:
    • 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>

💡Test Cases