Debugging Ingress in CKA course Practice Test - Ingress Networking 2 Question 8

Hi

In Question 8 of Part 2 of the Ingress Networking Practice Test, we were required to build an ingress resource to make the applications available at /wear and /watch. I managed to do everything except for the rewriting. I do not know why I would need to at first, but I did figure out why after looking at the answer.

This was the part missing

annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
nginx.ingress.kubernetes.io/ssl-redirect: “false”

I was wondering how can I debug ingress to find out why that it wasn’t working in the first place?

A quick google around mentions that you can look at the logs as it should be a pod. I can’t find a listing as a pod.

Any ideas?

Hello @lielarster

In this question, you can remove those 2 annotations and it will work fine as well.

the yaml file could be as followed
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ingress-wear-watch
namespace: app-space
spec:
rules:

  • http:
    paths:
    • path: /wear
      backend:
      serviceName: wear-service
      servicePort: 8080
    • path: /watch
      backend:
      serviceName: video-service
      servicePort: 8080

Is there a way to check the logs? What logs can I look at?

You can use describe command
$ kubectl describe ing ingress-resource-name -n namespace-of-ingress-resource

1 Like