kuberneteskubernetes-ingresskongkubernetes-networkingkong-ingress

Error "no Route matched with those values" with the Kong ingress controller


Attempting to connect to a Jupyter Lab container (ultimately other applications as well) running on a cloud managed Kubernetes service using Kong as the ingress controller. Receiving "no Route matched with those values" on the http response to Kong's public IP and the ingress-controller logs indicate:

service kong/rjup2 does not have any active endpoints
no configuration change, skipping sync to Kong

Deployment Config:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: rjup2
  namespace: kong
spec:
  selector:
    matchLabels:
      run: rjup2
  replicas: 1
  template:
    metadata:
      labels:
        run: rjup2
    spec:
      restartPolicy: Always
      containers:
        - name: rjup2
          image: jupyter/minimal-notebook
          imagePullPolicy: Always
          ports:
            - containerPort: 8888
              protocol: TCP

Service Config:

apiVersion: v1
kind: Service
metadata:  
  name: rjup2
  namespace: kong
spec:
  selector:    
    app: rjup2
  type: ClusterIP
  ports:  
  - name: http
    port: 80
    targetPort: 8888
    protocol: TCP

Ingress Resource Config:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: rjup2
  namespace: kong
spec:
  tls:
  - hosts:
      - <AKS API server address>
  rules:
  - host: <AKS API server address>
    http:
      paths:
      - path: /
        backend:
          serviceName: rjup2
          servicePort: 80

The API Server Address is properly populated in the deployed YAML. I have tried different namespaces before consolidating them under Kong's default namespace and also tried making the service ports 8888 in addition to the containers target port.

Thanks for any assistance in debugging this.


Solution

  • Your rjup2 Service doesn't have a valid selector. Note that the Pods you are trying to expose are labelled with run: rjup2 label and your Service has app: rjup2 selector.

    Btw. you get very clear error message that indicates where the problem could be:

    service kong/rjup2 does not have any active endpoints
    

    If your rjup2 service in kong namespace doesn't have any active endpoints, it means it doesn't expose your Pods properly which may indicate a possible mismatch in your configuration.

    You can check it by running:

    kubectl get ep -n kong
    

    Normally you should see the matching Endpoints object. In your case you won't see it as your Service cannot expose any pods untill it has a valid selector.

    If you fix your Service definition, everything should work just fine:

    apiVersion: v1
    kind: Service
    metadata:  
      name: rjup2
      namespace: kong
    spec:
      selector:    
        run: rjup2
      type: ClusterIP
      ports:  
      - name: http
        port: 80
        targetPort: 8888
        protocol: TCP