Replies: 26 comments 1 reply
-
Hi @llyons thanks for reporting! Be sure to check out the docs while you wait for a human to take a look at this 🙂 Cheers! |
Beta Was this translation helpful? Give feedback.
-
A couple of additional notes. I was trying to check to see if the config for the ingress was generated and I am not able to see anything in /etc/nginx. There is no folder named /etc/nginx running kubectl exec -n nginx-ingress -- cat /etc/nginx/nginx.conf returns ` worker_processes auto; error_log stderr notice; events { http {
} stream {
}` |
Beta Was this translation helpful? Give feedback.
-
Hi @llyons could you provide the output of:
We will take a look at your results. |
Beta Was this translation helpful? Give feedback.
-
Thanks Jason, Much appreciated. NGINX is in the nginx-ingress namespace I suspect there is something small. I am not getting anything generated in the /etc/nginx/conf.d folder. There is actually no /etc/nginx folder NAMESPACE NAME READY STATUS RESTARTS AGE NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE `` |
Beta Was this translation helpful? Give feedback.
-
Some additional results from some of the troubleshooting commands. kubectl describe pol webapp-policy kubectl describe vsr coffee kubectl describe vs cafe kubectl describe ing cafe-ingress Name: cafe-ingress cafe.example.com |
Beta Was this translation helpful? Give feedback.
-
I have tried to set the cafe.example.com host to the external IP of the ingress controller served up by metallb and I have tried to set cafe.example.com to the ip of one of the linux nodes where ingress controllers are running. In both cases I get this. $ curl http://cafe.example.com/ <title>404 Not Found</title>404 Not Foundnginx/1.21.0 $ curl http://cafe.example.com/tea <title>404 Not Found</title>404 Not Foundnginx/1.21.0 $ curl http://cafe.example.com/coffee <title>404 Not Found</title>404 Not Foundnginx/1.21.0 $ curl 10.109.253.105 $ curl 192.168.2.32:8080 |
Beta Was this translation helpful? Give feedback.
-
Hi @llyons
it is hard to tell from your output if a
Try that and let us know. |
Beta Was this translation helpful? Give feedback.
-
I did add the ingressClassname or uncommented it in the example and it seems to work. I was able set the cafe.example.com to the IP of the ingress (that was served up by metallb) and go to http://cafe.example.com/tea and http://cafe.example.com/coffee and get this. Server address: 192.168.2.31:8080 does that mean its working from your perspective? I still dont see files generated in /etc/nginx/conf.d |
Beta Was this translation helpful? Give feedback.
-
Hello @llyons
What you can do to check the config, logon to the NGINX ingress pod and execute:
Let us know if you have any other questions. |
Beta Was this translation helpful? Give feedback.
-
when you say logon to the NGINX ingress pod, how is that done? I have never done that. Are you meaning create a shell into the ingress container and run that command? Thanks |
Beta Was this translation helpful? Give feedback.
-
i seem to be missing something that might help understand how the routing should be setup to make these work. I have another helloworld example that I pulled over from an AKS deploy. it is tied to host helloworld.onlifehealth.com which points to the IP of the ingress controller like the cafe.example.com prior.
and the two deployments /services
with the above example I can see a response on http://helloworld.onlifehealth.com but i am seeing Not Found with these URLs http://helloworld.onlifehealth.com/hello-world-one and http://helloworld.onlifehealth.com/hello-world-two |
Beta Was this translation helpful? Give feedback.
-
Hi @llyons
Those specific annotations are for a different Ingress controller project and will not work with this particular NGINX Ingress controller. Those above are for the Community Edition of NGINX Ingress Controller maintained by the community. You will want to look at these annotations to use with your You will need to convert your annotations to the ones supported by this Ingress product. Here is a quick write I did of converting your
NOTE: I added In the above, you can remove the Any request that comes into Pardon any typos. |
Beta Was this translation helpful? Give feedback.
-
thanks alot. i appreciate that. I was able to get a few other of our apps working behind the ingress. I will spend time this afternoon trying to digest the info you just provided like the virtualserver kind and the different annotations again thanks |
Beta Was this translation helpful? Give feedback.
-
@llyons You are very welcome. |
Beta Was this translation helpful? Give feedback.
-
one more question.. I change the hello world to use the virtual server and change the service definitions to have -svc as you did. I am able to curl the IP of the pod and the IP of the service NAMESPACE NAME READY STATUS RESTARTS AGE IP NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR so curl 192.168.1.28 or 10.110.232.106 returns data from app hello-world-one however i have my ingress controller set to IP 10.244.0.30 nginx-ingress service/nginx-ingress LoadBalancer 10.111.32.192 10.244.0.30 80:32132/TCP,443:32544/TCP 18d app=nginx-ingress and have helloworld.onlifehealth.com set to this ip in my hosts file. http://helloworld.onlifehealth.com works should the virtualserver have an IP? I am guessing I cant get to the new virtualserver through the ingress controller IP. kubectl get vs NAME STATE HOST IP PORTS AGE also kubectl describe vs aks-helloworld Name: aks-helloworld |
Beta Was this translation helpful? Give feedback.
-
It looks like the path / works with the above virtualserver configuration but the other paths /hello-world-one and /hello-world-two do not. I did change the path / to point to the other service as well just to confirm the two pods/services are working. For some reason the /something paths are not routhing. No errors in the logs that I can see. im guessing this is a simple issue that I have set wrong. kubectl describe vs aks-helloworld
|
Beta Was this translation helpful? Give feedback.
-
@llyons https://docs.nginx.com/nginx-ingress-controller/troubleshooting/#checking-the-generated-config |
Beta Was this translation helpful? Give feedback.
-
Hi Jason, Thanks. We dont seem to get any auto generated nginx.conf in the /etc/nginx/conf.d folder so I am a bit confused there. Here the the complete nginx.conf from the command kubectl exec -n nginx-ingress -- nginx -T sorry for how busy this is.
|
Beta Was this translation helpful? Give feedback.
-
Can you provide the output of:
also, are you curling the hostname or the IP? Where are you curling/accessing the app from? Outside the cluster? inside the cluster? |
Beta Was this translation helpful? Give feedback.
-
Hi Jason, I am able to curl the pods and the svc using the IP of the pod and svc from the master. I was able to change the VirtualServer definition to have / go to hello-world-one and hello-world-two and both work.
and
both bring up the different pods/svc under http://helloworld.onlifehealth.com However they dont work when behind the path /hello-world-one or /hello-world-two http://helloworld.onlifehealth.com/hello-world-one (or two) do not work and give the error
Have not modified the coffee/tea example yet although i really am hoping to get to the point where we can use virtualservers and virtualserverroutes since this lines up a little more with our F5 approach used in the past. kubectl get po,svc -A
|
Beta Was this translation helpful? Give feedback.
-
So I did convert the cafe.example.com from ingress to virtualserver. NVM what I added below. it does work. Without the tls: it was behaving the same way relative to the /tea /coffee paths but with that in, it works fine**
the behavior is the same... If I go to http://cafe.example.com i get. Server address: 192.168.2.34:8080 if I go to http://cafe.example.com/tea or /coffee it throws the 404 not found. here is the unique nginx.conf
|
Beta Was this translation helpful? Give feedback.
-
@llyons
Also, can you do a:
Post the above output in here as well. Can you also run a few curl commands with Your nginx config looks correct |
Beta Was this translation helpful? Give feedback.
-
Hi Jason, the coffee tea conversion to virtualserver does work. The simple helloworld app doesnt. I did remove the ingress for each after creating the virtual server. kubectl get ing,vs -A
kubectl get vs aks-helloworld
On the curl -v curl -v helloworld.onlifehealth.com
curl -v helloworld.onlifehealth.com/hello-world-one
|
Beta Was this translation helpful? Give feedback.
-
Here are my deployment yaml files. I had used these during some work in AKS although we are deploying into an on prem k8 cluster. hello-world-virtualserver.yml.txt |
Beta Was this translation helpful? Give feedback.
-
I do want to express my thanks for the help on this. Thanks! I know this was not a bug with the product. That leads me to the next general question, what is the best way to ask these questions related to the nginx ingress controller that are not bugs,etc. I know there are some slack channels for the ingress-nginx product. |
Beta Was this translation helpful? Give feedback.
-
@llyons https://docs.microsoft.com/en-us/azure/aks/ingress-basic I have not broken down the application itself (yet, but will because I am curious now), but it looks like that particular setup is looking for a I wanted to test out a few things for you, so I downloaded a simple Essentially, all I did was swap out your particular image with a 'hello-world' response image to verify that KIC would route properly based on the request, to the proper backend :
I used your exisiting VS setup to test with the new image. Question: Is there something specific you need to test out with your given setup with that particular image? Do you have a particular use case that you are trying to solve with that example, or something else? My testing for this: Deployment and services for simple 'hello response'
And my NGINX VS setup:
And my curl responses, for the specific paths:
Also, results of my
Hope this is helpful. |
Beta Was this translation helpful? Give feedback.
-
Describe the bug
with kubernete 1.21.1 cluster (with 3 linux and 3 windows nodes) and nginx-ingress (kubernetes-ingress v1.11.3 ) we are constantly getting 404 not found
To Reproduce
Steps to reproduce the behavior:
kubectl get svc -o wide -n nginx-ingress
kubectl get ingress
NAME CLASS HOSTS ADDRESS PORTS AGE
cafe-ingress cafe.example.com 80, 443 39m
kubectl get pods -A showing only cafe related
default coffee-6d68b8ff4f-8jdkf 1/1 Running 0 31m
default coffee-6d68b8ff4f-g5rpk 1/1 Running 0 31m
default tea-766cdd6757-gdj57 1/1 Running 0 31m
default tea-766cdd6757-kswcj 1/1 Running 0 31m
default tea-766cdd6757-smqjx 1/1 Running 0 31m
doing curl --resolve cafe.example.com:80:10.244.0.30 -v http://cafe.example.com returns 404
< HTTP/1.1 404 Not Found
<title>404 Not Found</title>< Server: nginx/1.21.0
< Date: Thu, 17 Jun 2021 19:22:37 GMT
< Content-Type: text/html
< Content-Length: 153
< Connection: keep-alive
<
404 Not Found
nginx/1.21.0 * Connection #0 to host cafe.example.com left intact 2. View logs on '....' 3. See error
Expected behavior
expected the nginx-ingress to route to the cafe or tea deployments
Your environment
kubectl get ingress cafe-ingress
NAME CLASS HOSTS ADDRESS PORTS AGE
cafe-ingress cafe.example.com 80, 443 43m
kubectl describe ingress cafe-ingress
Name: cafe-ingress
Namespace: default
Address:
Default backend: default-http-backend:80 (<error: endpoints "default-http-backend" not found>)
TLS:
cafe-secret terminates cafe.example.com
Rules:
Host Path Backends
cafe.example.com
/tea tea-svc:80 (192.168.1.26:8080,192.168.2.33:8080,192.168.2.34:8080)
/coffee coffee-svc:80 (192.168.2.31:8080,192.168.2.32:8080)
Annotations:
Events:
curl 192.168.1.26:8080
Server address: 192.168.1.26:8080
Server name: tea-766cdd6757-kswcj
Date: 17/Jun/2021:19:26:10 +0000
URI: /
Request ID: 60d611f651c50b9186804c420882fc8e
curl cafe.example.com
<title>404 Not Found</title>404 Not Found
nginx/1.21.0
Beta Was this translation helpful? Give feedback.
All reactions