Kindly send the answer

We have deployed two applications called circle-apd and square-apd on the default namespace using the kodekloud/webapp-color:v1 and kodekloud/webapp-color:v2.

We have done all the tests and do not want circle-apd deployment to receive traffic from the foundary-svc service anymore. So, route all the traffic to another existing deployment.

Do change the service specifications to route traffic to the square-apd deployment.

You can test the application from the terminal by running the curl command with the following syntax: -

curl http://cluster3-controlplane:NODE-PORT
<!doctype html>
<title>Hello from Flask</title>
...
  <h2>
    Application Version: v2
  </h2>

As shown above, we will get the Application Version: v2 in the output.

I have updated the foundary-svc in selector field with square-apd’s selector label but this command is not working and testcase failed.
curl http://cluster3-controlplane:32043

apiVersion: v1
kind: Service
metadata:
creationTimestamp: “2024-01-02T05:42:33Z”
labels:
app: foundary-svc
name: foundary-svc
namespace: default
resourceVersion: “2963”
uid: bc11bc99-0f3e-4cc8-bf37-54fc02904ce0
spec:
clusterIP: 10.107.144.147
clusterIPs:

  • 10.107.144.147
    externalTrafficPolicy: Cluster
    internalTrafficPolicy: Cluster
    ipFamilies:
  • IPv4
    ipFamilyPolicy: SingleStack
    ports:
  • nodePort: 32043
    port: 8080
    protocol: TCP
    targetPort: 8080
    selector:
    app-kgh: route02
    sessionAffinity: None
    type: NodePort
    status:
    loadBalancer: {}

Can you please post YAML

in code blocks

What you have pasted above has lost all indentation and cannot be verified.