Giter VIP home page Giter VIP logo

Comments (8)

nicksardo avatar nicksardo commented on July 17, 2024 8

You probably have an ingress referencing a service that's not type NodePort. It may not be the newly added ingress, it could be any GCE ingress.

from ingress-gce.

FossPrime avatar FossPrime commented on July 17, 2024 4

I was able to solve it by adding an annotation to disable the Google LB for my ingress.

metadata:
  name: test-deployment
  annotations:
    kubernetes.io/ingress.class: "nginx"

http://blog.chronos-technology.nl/post/disabling-gke-load-balancer-in-kubernetes/

from ingress-gce.

stevenbarragan avatar stevenbarragan commented on July 17, 2024 3

You where right, it wasn't even the ingress I just created, it was another one I lost track of.

Thanks for the help.

Better errors would be nice though 😬

from ingress-gce.

ddehghan avatar ddehghan commented on July 17, 2024

Yes. kubernetes.io/ingress.class: nginx can handle services that are exposed by ClusterIp. We have it working in production

from ingress-gce.

FossPrime avatar FossPrime commented on July 17, 2024

@ddehghan I definitely tried that in GKE with no luck, I'm having to use a dynamic IP on a node, which changes every k8s update. Are you sure you're using cluster ip and not node ip?

from ingress-gce.

ddehghan avatar ddehghan commented on July 17, 2024

Here is my settings. nginx-ingress-controller is deployed in the cluster and gets the traffic from the External Load balancer on GKE. We dont expose our pods to the GCE ingress. We just use it to bring the traffic to our own nginx-ingress. With the settings below the traffic gets routed correctly. But we still see this error

"googleapi: Error 400: Invalid value for field 'namedPorts[4].port': '0'. Must be greater than or equal to 1, invalid"

I am pretty sure this is just a bug. I deleted the ingress and recreated it and the error went away.
It actually happens consistently. I changed the service type form Nodeport to ClusterIP and back and the errors appears. And I deleted the ingress and recreated it and the error goes away.

---
Not shown is the nginx-ingress-controller deployed with helm.
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:

  name: https-ingress

  annotations:
    kubernetes.io/ingress.class: nginx
    certmanager.k8s.io/cluster-issuer: letsencrypt-prod-cluster-issuer
spec:

  tls:
  - secretName: example-prod-tls
    hosts:
    - example.io
    - '*.example.io'

  rules:

  - host: test2.example.io
    http:
      paths:
      - path: /
        backend:
          serviceName: dm-django-stage
          servicePort: dm-django-port
---
apiVersion: v1
kind: Service
metadata:
  name: dm-django-stage
spec:
  ports:
  - name: dm-django-port
    port: 5000
    protocol: TCP
    targetPort: 5000
  selector:
    app: dm-django
  type: NodePort            <--  or ClusterIP here. They both work.



from ingress-gce.

Freyert avatar Freyert commented on July 17, 2024

I know everyone is going to love this, but the way I was able to fix this was to delete and reinstall the NGINX Ingress controller itself. Now I'm using ClusterIP for my service and the ingress can assign addresses to it!

This is using stable/nginx-ingress-0.28.2 from https://github.com/helm/charts

from ingress-gce.

FossPrime avatar FossPrime commented on July 17, 2024

@Freyert are you on GKE? I suspect their firewalls make this impossible

from ingress-gce.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.