question

NikolaRadovanovic-0150 avatar image
0 Votes"
NikolaRadovanovic-0150 asked karishmatiwari-msft commented

How to forward TCP traffic to pod from the outside world

Hi,
First of all, I am new to Kubernetes and for past couple of days I am struggling with something I would expect to be a simple task.

I want to forward TCP on specific port(s) to a running pod. As a reference I take a look here. With minikube locally, it works as expected (apart wrong namespace in tutorial document: should be kube-system).

However, after 3 days of trying to achieve the same on AKS my frustration only get bigger and bigger and I am on the verge of hating Kubernetes before I even starting to use it. Can someone please explain me in plain English how to expose TCP ports using Nginx ingress to outside world.

What I try so far is basically as follows:

 kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v0.44.0/deploy/static/provider/cloud/deploy.yaml
 kubectl apply -f redis-deployment.yaml
 kubectl apply -f redis-service.yaml
 kubectl patch configmap tcp-services -n ingress-nginx --patch '{"data":{"6379":"default/redis-service:6379"}}'
 kubectl -n ingress-nginx patch service ingress-nginx-controller -p '{"spec": {"ports": [{"name":"http","port":80,"protocol":"TCP","targetPort":"http"},{"name":"https","port":443,"protocol":"TCP","targetPort":"https"},{"name":"redis","port":6379,"protocol":"TCP","targetPort": 6379}]}}'

But I can't access from the outside and I don't see 6379 port in ingress-nginx-controller listed. Looks I am missing something, but I cant see what.

I find Kubernetes extremely complicated so far. Docker & compose are much cleaner and their docs are way much better.








azure-kubernetes-service
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for raising this question! Firstly, apologies for the delay in responding here and any inconvenience this issue may have caused.

We need to analysis the issue from the backend. I would recommend to contact support if you have a support plan. Otherwise please do let us know, we will help you get a one-time free technical support. In this case, could you send an email to AzCommunity[at]Microsoft[dot]com referencing this thread as well as your subscription ID. Please mention "ATTN Karishma" in the subject field.

Thanks for your patience and co-operation.

0 Votes 0 ·

0 Answers