Question

Cannot make the nginx-ingress controller work with Kubernetes cluster

I wanted to test out NGINX Ingress Controller one click installation on digital-ocean, so I deployed a very simple app and created several Kubernetes resource as the following:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: app-test
spec:
  replicas: 1
  selector:
    matchLabels:
      app: app-test
  template:
    metadata:
      labels:
        app: app-test
    spec:
      containers:
        - name: app-test
          image: <my-image-from-docker-hub>
          ports:
            - containerPort: 80
          imagePullPolicy: Always
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: ingress-app-test
spec:
  backend:
    serviceName: app-test
    servicePort: 80
apiVersion: v1
kind: Service
metadata:
  name: app-test
spec:
  selector:
    app: app-test
  ports:
    - port: 80
      targetPort: 80

The container that runs is a very simple web application that works just fine, also port-forwarding to it works just fine.

However, when I try to access the external IP of the load balancer that is deployed as part of the nginx-ingress I expect to see the homepage of the web application but I just get 503 error from nginx.

Looking at the logs of the nginx ingress controller, I can see an error indicating:

Error creating upstream "ingress-nginx-app-test-80": no object matching key "ingress-nginx/app-test" in local store

What I am missing here ?


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi there,

Looking around this looks very similar to: https://github.com/kubernetes/ingress-nginx/issues/4579. Perhaps try their solution.

A few things you may want to try:

Hope this helps!

John Kwiatkoski