Troubleshooting Kubernetes ingress

5/26/2021

I am starting out with Kubernetes and have what I think are some fairly basic questions. I know there are a number of resources out there about how Kubernetes ingress works and presents underlying services, but I am at the level where I need some input specific to what I am looking at as I'm finding it difficult filtering out what I don't need to know from what I do.

I am using the Jenkins helm chart from here: https://github.com/jenkinsci/helm-charts to run a basic Jenkins setup. I am overriding a small number of values using my own file:

controller:
  component-name: "jenkins-controller"
  customJenkinsLabels:
    - "home-lab"
    - "jenkins-testing"
  ingress:
    enabled: true
    hostName: "myjenkins.home.com"
    paths: []
    kubernetes.io/ingress.class: nginx

I am running this in Minikube on Windows 10 and have the ingress addon enabled. I can drop in to a bash shell on the default container within the nginx ingress controller pod and do a netcat to both the service and endpoint's respective IPs on TCP 8080, but the ingress controller's logs (shown using kubectl logs -n ingress-nginx ingress-pod-name) say that the "Service does not have any active Endpoint". If I chuck in a hosts file entry on my machine pointing myjenkins.home.com at the ingress resource's address (kubectl get ingress) I get no response when hitting http://myjenkins.home.com in a browser. I also can't see the ingress controller's load balancer listening on TCP 80 when I run netstat on my local machine (which I would have thought I should be able to).

I'm not looking for someone to give me all the answers, but I just want to get a bit of guidance on my general troubleshooting process so that I can feed myself and actually decide whether what I read is relevant or not. To give an idea of some of the things I am thinking I'll list stuff that I want to answer:

  • Does ingress talk to the endpoint or service IP?
  • How does the ingress definition decide which service or endpoint it uses?
  • Should I be able to contact either the service or endpoint (where relevant) from my ingress controller pod using cURL?
  • Which logs should I be focusing on for a problem of this nature?
  • How do I best see the "running config" of any component?
    • Currently using kubectl get blah -o yaml

I know that's not all the required info but I can provide more if anyone is kind enough to offer a bit of input. Cheers!

Edit: Adding in output of kubectl commands requested by @Lukman

PS C:\> kubectl get pod,deploy,cm,secret,svc -n ingress-nginx
NAME                                            READY   STATUS      RESTARTS   AGE
pod/ingress-nginx-admission-create-zx2jh        0/1     Completed   0          6d18h
pod/ingress-nginx-admission-patch-zdh84         0/1     Completed   0          6d18h
pod/ingress-nginx-controller-5d88495688-2djx5   1/1     Running     2          6d18h

NAME                                       READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/ingress-nginx-controller   1/1     1            1           6d18h

NAME                                        DATA   AGE
configmap/ingress-controller-leader-nginx   0      6d18h
configmap/ingress-nginx-controller          1      6d18h
configmap/kube-root-ca.crt                  1      6d18h
configmap/tcp-services                      0      6d18h
configmap/udp-services                      0      6d18h

NAME                                         TYPE                                  DATA   AGE
secret/default-token-4459z                   kubernetes.io/service-account-token   3      6d18h
secret/ingress-nginx-admission               Opaque                                3      6d18h
secret/ingress-nginx-admission-token-br28x   kubernetes.io/service-account-token   3      6d18h
secret/ingress-nginx-token-pz9vq             kubernetes.io/service-account-token   3      6d18h

NAME                                         TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)                      AGE
service/ingress-nginx-controller             NodePort    10.103.198.94   <none>        80:32732/TCP,443:30516/TCP   6d18h
service/ingress-nginx-controller-admission   ClusterIP   10.96.137.122   <none>        443/TCP                      6d18h
-- sh_so
kubernetes
kubernetes-helm
minikube
nginx-ingress

0 Answers