Task Summary
Create an Ingress named echo in the sound-repeater namespace that:
Routes requests to /echo on host example.org
Forwards traffic to service echoserver-service
Uses service port 8080
Verification should return HTTP 200 using curl
✅ Step-by-Step Answer
1️⃣ SSH into the correct node
As shown in the image:
bash
CopyEdit
ssh cka000024
⚠️ Skipping this will result in a ZERO score!
2️⃣ Verify the namespace and service
Ensure the sound-repeater namespace and echoserver-service exist:
kubectl get svc -n sound-repeater
Look for:
echoserver-service ClusterIP ... 8080/TCP
3️⃣ Create the Ingress manifest
Create a YAML file: echo-ingress.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: echo
namespace: sound-repeater
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$1
spec:
rules:
- host: example.org
http:
paths:
- path: /echo
pathType: Prefix
backend:
service:
name: echoserver-service
port:
number: 8080
4️⃣ Apply the Ingress resource
kubectl apply -f echo-ingress.yaml
5️⃣ Test with curl as instructed
Use the exact verification command:
curl -o /dev/null -s -w "%{http_code}\n" http://example.org/echo
✅ You should see:
200
✅ Final Answer Summary
ssh cka000024
kubectl get svc -n sound-repeater
# Create the Ingress YAML
cat < echo-ingress.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: echo
namespace: sound-repeater
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$1
spec:
rules:
- host: example.org
http:
paths:
- path: /echo
pathType: Prefix
backend:
service:
name: echoserver-service
port:
number: 8080
EOF
kubectl apply -f echo-ingress.yaml
curl -o /dev/null -s -w "%{http_code}\n" http://example.org/echo