Question 1: Identify the Deployment Strategy
Begin by identifying the deployment strategy used for the deployment in the default namespace.-
List all deployments by running:
-
Next, inspect the details of the “frontend” deployment to check its strategy:
Question 2: Identify the Correct Service
The “frontend” deployment is connected to a NodePort service. Follow these steps to verify the service:-
List the services:
-
Describe the service to inspect its configuration:
app=frontend) matches the pod labels in the “frontend” deployment, the correct service is frontend-service.
Question 3: Accessing the Web Application
To confirm that the web application is running, click the web app button provided in the interface. This step verifies that the application is accessible and functioning as expected.Reload the web application multiple times to observe consistency in responses from the running version.
Question 4: Traffic Splitting with a New Deployment
A new deployment, frontend-v2, has been created in the default namespace with an updated image. The goal is to divert less than 20% of traffic to this new version, while keeping the total number of pods unchanged.-
Verify both deployments:
With the same selector (
app=frontend), traffic is balanced across 7 pods (5 for frontend and 2 for frontend-v2), meaning frontend-v2 receives approximately 28% of the traffic. -
To reduce the traffic to about 16.7%, scale down frontend-v2 to 1 replica:
-
Confirm the change:
Question 5: Redirect All Traffic to the New Version (v2)
Once you have confirmed that the new version functions correctly, safely redirect all traffic to frontend-v2 by following these steps:-
Scale down the original frontend deployment:
-
Scale up the frontend-v2 deployment to handle all traffic:
-
Verify the updates:
-
Finally, remove the old frontend deployment entirely:
Ensure that your testing confirms the new deployment is stable before fully decommissioning the original version.
