Kubernetes pods can't be exposed with Ingress

1/27/2019

I'm trying to set up a kubernetes cluster with a couple backend services, which are served through an ingress instance.

I've set up my Deployment, Services and Ingress in kubernetes. Yet, due to an unknown error, I can't get the ingress working and act as a load balancer for my backend services.

Name                    | Status   |    Type     | Endpoints              | Pods    | Namespace |   Cluster
ev-ingress              |    OK    | Ingress     | */evauth               |  0 / 0  | default    |standard-cluster-1
ev-auth-service         |   OK     | Node port  |    <NODE_PORT_IP>:80 TCP| 1 / 1   |default |  standard-cluster-1

backend.yml

---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: ev-auth
spec:
  selector:
    matchLabels:
      app: ev-auth
  replicas: 1
  template:
    metadata:
      labels:
        app: ev-auth
    spec:
      containers:
      - name: ev-auth
        image: private_repository/ev-auth
        readinessProbe:
          httpGet:
            path: /health
            port: 3000
        livenessProbe:
          httpGet:
            path: /health
            port: 3000
        ports:
        - containerPort: 3000
        env:
        - name: PORT
          value: "3000"
        - name: AMQP_CONNECTION
          value: amqp://xxxxxxx
        - name: CALLBACK
          value: "CALLBACK"
        - name: CONSUMER_KEY
          value: xxxxxxxxx
        - name: CONSUMER_SECRET
          value: xxxxxxxx
---
apiVersion: v1
kind: Service
metadata:
  name: ev-auth-service
  labels:
    app: ev-auth
spec:
  type: NodePort
  selector:
    app: ev-auth
  ports:
  - name: normal
    port: 80
    targetPort: 3000
    protocol: TCP

ingress.yml

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: ev-ingress
spec:
  rules:
  - http:
      paths:
      - path: /evauth
        backend:
          serviceName: ev-auth-service
          servicePort: 80

What am I missing here? I made sure /evauth indeed works, (I'm not sure if that's even necessary to match but, anyway). Still, the Ingress mapping shows "0/0" for pods. When I call the "http://cluster_ip/evauth", I get "default backend - 404"

Any help is appreciated.

Thanks.

-- Akaedintov
google-kubernetes-engine
kubernetes
kubernetes-ingress

1 Answer

1/27/2019

Turns out, I was hasty. Apparently I had to wait for a while.

After 10 minutes, things were working as expected.

-- Akaedintov
Source: StackOverflow