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 ?
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.
×