koli / kong-ingress

[DEPRECATED] A Kubernetes Ingress for Kong
Other
93 stars 14 forks source link

having difficulties using servicePort that isn't 80 #16

Closed remster closed 7 years ago

remster commented 7 years ago

is there a known problem/limitation with it?

cainelli commented 7 years ago

Hey @remster, can you send the service and ingress yml you're using?

The logs from kong-ingress controller would also be useful.

sandromello commented 7 years ago

Hi remster,

Indeed there is, I will make a quick test here just to be sure.

remster commented 7 years ago
apiVersion: apps/v1beta1 # for versions before 1.6.0 use extensions/v1beta1
kind: Deployment
metadata:
  name: sample-service
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: sample-service
    spec:
      containers:
      - name: sample-service
        image: sample-service:0.0
        env:
          - name: PORT
            value: "3000"
---
kind: Service
apiVersion: v1
metadata:
  name: sample-service
spec:
  ports:
    - protocol: TCP
      port: 3000
      targetPort: 3000
  selector:
    app: sample-service
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: sample-service-ingress
  annotations:
    kolihub.io/acme.local: primary
spec:
  rules:
  - host: remek.ele
    http:
      paths:
      - path: /ele
        backend:
          serviceName: sample-service
          servicePort: 3000

sorry - dunno how to harvest logs from the kong-ingress controller

sandromello commented 7 years ago

I've released a new version allowing custom ports, I tested with kubernetes v1.7.0. Please let me known if this version solves this issue: quay.io/koli/kong-ingress:v0.2.1-alpha

The ingress is integrated with Kubernetes, if there's any error processing ingress resources you could check the reason viewing the events from the target namespace. E.g.:

kubectl get events -n default
LASTSEEN   FIRSTSEEN   COUNT     NAME                     KIND         SUBOBJECT                TYPE      REASON                    SOURCE                  MESSAGE
7m         9m          9         acme-routes              Ingress                               Warning   ServiceNotFound           kong-controller         Service 'web' not found for ingress

If you need a more verbose output you could check the logs of the kong-ingress-controller:

kubectl logs <kong-ingress-pod> -n kong-system
sandromello commented 7 years ago

If you have problems please reopen this issue.

remster commented 7 years ago

Thanks @sandromello - i confirm this is now fixed.