- I use a local kubernetes bundled with docker on Mac OS.
- I've installed the nginx-ingress-controller.
- I manged to send external http request via ingress to my kubernetes managed containers (e.g. from my local browser). All request are sent via the nginx ports 80 or 443.
The problem is, that I can only route http or https requests via my ngnix controller. How can I send non HTTP Requests (e.g. database or corba) via ingress to my containers?
This is not well supported via the ingress mechanism and is an open issue.
There is a work around for tcp or udp traffic using nginx-ingress which will map an exposed port to a kubernetes service using a configmap.
See this doc.
Start the ingress controller with the
tcp-services-configmap
(and/orudp-services-configmap
) argument.deploy configmap:
where
9000
is the exposed port and8080
is the service portI'm using a nginx-ingress-controller on a bare-metal server. In order to get on the hosted sites from all nodes, I created it as a DaemonSet rather than a Deployment (Bare-metal considerations).
The solution works well and updates on the Ingress specifications are perfectly integrated.
For the sake of making a TS Server available, I changed my args for the Pods in nginx-ingress-controller.yml as mentioned by stacksonstacks:
Unfortunately, when applying the changed specification, the DaemonSet did not automatically recreate the Pods, so when inspecting the Pods, I still had the old args:
Deleting the Pods inside ingress-nginx namespace with
kubectl --namespace ingress-nginx delete pod --all
made the controller create new Pods and finally the ports were available on the host-network.I know the circumstances might be a bit different, but hopefully someone can save a few minutes with this.