Comments (38)
Incase it is not from the security context, are you using CNI for your cluster? If so the hostPort entries are ignored right now by CNI implementations (see this issue). If that is indeed your problem, try hostNetworking: true
to make the container use the host's network instead of just the ports. This works in the meantime over CNI.
from kubernetes-ingress.
from kubernetes-ingress.
from kubernetes-ingress.
@abdoo
My apologies for the delayed response. From my understanding, this file is used to deploy the controller https://github.com/fabric8io/fabric8-devops/blob/master/ingress-nginx/src/main/fabric8/deployment.yml As you can see, ports 80 and 443 on the container are mapped to ports 80 and 443 on the host machine. NGINX can't start probably because one or both of those ports are taken by some other application or a container running on that machine.
Unfortunately, we don't report the exact error when NGINX isn't able start. This will be fixed.
from kubernetes-ingress.
from kubernetes-ingress.
from kubernetes-ingress.
I try to check what's using these ports. I have another question related to
this. my servers are running on private Env. so I need proxy to connect to
Internet. I configured all applications on these servers to use this proxy
(docker, curl..etc). does NGINX needs to be configured to use this proxy as
well?
NGINX doesn't require outbound Internet connectivity so there's no need to configure it for NGINX.
also I checked these two ports 80 and 443 and they not being used on the
server.
I think it's the issue when your Kubernetes environment doesn't allow to create containers that expose privileged ports on the host. Could you try to add
securityContext:
privileged: true
to the NGINX deployment yaml file and then redeploy the controller, similar to https://github.com/nginxinc/kubernetes-ingress/pull/53/files ?
from kubernetes-ingress.
from kubernetes-ingress.
from kubernetes-ingress.
@abdoo
securityContext
must be put one level up into the Container spec, not the Port spec.
from kubernetes-ingress.
from kubernetes-ingress.
from kubernetes-ingress.
NGINX returns the bad gateway error when there is no healthy upstream servers available. Please double check that the containers of the service you are exposing via NGINX are successfully created and running properly. Checking the controller logs also night help to determine the problem.
Additionally, I suggest to try to use the latest version of the controller, which is nginxdemos/nginx-ingress:0.6.0
from kubernetes-ingress.
from kubernetes-ingress.
from kubernetes-ingress.
@abdoo
Could you also list Ingress resources?
from kubernetes-ingress.
from kubernetes-ingress.
@abdoo The problematic one is http://fabric8.default.10.103.12.20.nip.io ?
Could you do the following:
$ kubectl get -o yaml ing fabric8
$ kubectl describe svc fabric8
Could you also looks through NGINX logs and find the generated config related to the fabric8 ingress?
from kubernetes-ingress.
from kubernetes-ingress.
@abdoo The generated configuration looks good.
When you get the 502 error, could you past the related log entry from the NGINX logs?
Could you connect to the pod, install curl and try to connect to any of the endpoints?
$ kubectl exec <nginx-pod> -it -- bash
# apt-get update -y
# apt-get install -y curl
# curl http://172.16.87.3:9090
from kubernetes-ingress.
from kubernetes-ingress.
@abdoo Could you setup kubectl to bypass the squid proxy when connecting to the API server?
from kubernetes-ingress.
from kubernetes-ingress.
@abdoo
In your case, kubectl using a proxy to connect to the API server, which resides on the same host from my understanding, so using a proxy for that isn't necessary. Could make it bypass the proxy temporary?
Also, could you try to run the commands like below fist and see if they will work:
$ kubectl exec <nginx-pod> -- apt-get update -y
...
from kubernetes-ingress.
from kubernetes-ingress.
@abdoo
Could you try to connect to any of the servers like http://fabric8.default.10.103.12.20.nip.io and then find the error in the NGINX logs? It will tell why NGINX couldn't connect to the endpoint.
This might work to bypass the proxy: $ HTTPS_PROXY='' kubectl exec ...
from kubernetes-ingress.
from kubernetes-ingress.
so from above nginx did the correct mapping but it cant reach the server
itself?
That's correct
from kubernetes-ingress.
from kubernetes-ingress.
@abdoo That's great that you found out the root cause. I'm not sure If I can help
from kubernetes-ingress.
from kubernetes-ingress.
@abdoo
The Ingress controller is deployed on the nodes with the following label -- fabric8.io/externalIP: true
-- according to https://github.com/fabric8io/fabric8-devops/blob/master/ingress-nginx/src/main/fabric8/deployment.yml It looks like in your case there are no nodes with that label. You can check it by running kubectl get nodes -l fabric8.io/externalIP=true
. Not sure why those labels are not assigned to the nodes as I'm not familiar with the fabric8 installation.
from kubernetes-ingress.
from kubernetes-ingress.
from kubernetes-ingress.
[root@centos-master ~]# telnet 0 80
Are you sure that the controller is running on the master node?
Could you also add the hostNetwork: true
to the Pod spec of the controller and see if that helps?
from kubernetes-ingress.
from kubernetes-ingress.
from kubernetes-ingress.
@abdoo
Sorry for the confusion. By the controller I meant the NGINX Ingress controller.
Could you change its deployment by adding hostNetwork: true
to the Pod spec?
from kubernetes-ingress.
Related Issues (20)
- nginx.org/rewrites regular $1 rewrite is not supported HOT 7
- dlopen() "/etc/nginx/modules/ngx_http_js_module.so" failed (/etc/nginx/modules/ngx_http_js_module.so: cannot open shared object file: No such file or directory HOT 7
- Add NAP DoS version to pod labels and logs HOT 1
- Add `ip` as an option to listeners HOT 1
- Issue while installing ingress nginx controller v1.11.1 HOT 2
- Write python test for NIC+WAFv5 integration HOT 1
- sync updates from nginx-openid-connect repo HOT 1
- Make sure that the images built locally are the same as we build in the pipeline HOT 1
- Expose latency metrics for gRPC services in Prometheus HOT 1
- Extend `ip` as an option to listeners for TransportServer HOT 1
- Release NGINX Ingress Controller 3.6.2
- Release NGINX Ingress Controller 3.6.2 - Marketplaces
- POC - Make it easier to "attach" a VirtualServerRoute to a VirtualServer
- Helm chart >0.10.4 not found HOT 3
- Adding support forward all headrs from downstream to upstream HOT 2
- Investigate codecov reports HOT 1
- Investigate the feasability of a schemaless helm chart.
- make access log config map params work for stream
- Update release automation to append new versions of AppProtect WAF v5 HOT 1
- Exclude autogenerated, go tooling and vendor files from codecov HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kubernetes-ingress.