<p>I have Azure Kubernetes Service cluster and I have VM outside the cluster, from different virtual network, from which I try to connect to my container Pod App which is being run on TCP Port 9000. I must not use Public IP and That is not HTTP connection, but I need to connect using the TCP connection.
For that I followed instructions from this link:
<a href="https://learn.microsoft.com/en-us/azure/aks/ingress-internal-ip" rel="noreferrer">https://learn.microsoft.com/en-us/azure/aks/ingress-internal-ip</a>
I defined YAML file for helm install</p>
<pre><code>controller:
  service:
    annotations:
      service.beta.kubernetes.io/azure-load-balancer-internal: &quot;true&quot;
</code></pre>
<p>I configured nginx:</p>
<pre><code>helm install nginx-ingress ingress-nginx/ingress-nginx \
    -f internal-ingress.yaml \
    --set controller.nodeSelector.&quot;beta\.kubernetes\.io/os&quot;=linux \
    --set defaultBackend.nodeSelector.&quot;beta\.kubernetes\.io/os&quot;=linux \
    --set controller.admissionWebhooks.patch.nodeSelector.&quot;beta\.kubernetes\.io/os&quot;=linux
</code></pre>
<p>NGINX configuration after that is that it has Ports 80 and 443:</p>
<pre><code>kubectl get services -o wide

NAME                                        TYPE        CLUSTER-IP    EXTERNAL-IP     PORT(S)
nginx-ingress-ingress-ngingx controller  LoadBalancer   10.0.36.81    10.33.27.35     80:31312/TCP,443:30653/TCP
</code></pre>
<p>After that I run the <code>helm upgrade</code>
to ensure my tcp port 9000 is being configured</p>
<pre><code>helm upgrade nginx-ingress ingress-nginx/ingress-nginx -f internal-ingress.yaml --set tcp.9000=&quot;default/frontarena-ads-aks-test:9000&quot;
</code></pre>
<p>This gave me the ConfigMap setting automatically when I check with &quot;kubectl get configmaps&quot;:</p>
<pre><code>apiVersion: v1
data:
  &quot;9000&quot;: default/frontarena-ads-aks-test:9000
kind: ConfigMap
</code></pre>
<p>I have also edited my nginx Service:</p>
<pre><code>spec:
  clusterIP: 10.0.36.81
  externalTrafficPolicy: Cluster
  ports:
  - name: http
    nodePort: 31312
    port: 80
    protocol: TCP
    targetPort: http
  - name: https
    nodePort: 30653
    port: 443
    protocol: TCP
    targetPort: https
  - name: 9000-tcp
    nodePort: 30758
    port: 9000
    protocol: TCP
    targetPort: 9000
</code></pre>
<p>I have my deployed App Pod :</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: frontarena-ads-deployment
  labels:
    app: frontarena-ads-deployment
spec:
  replicas: 1
  template:
    metadata:
      name: frontarena-ads-aks-test
      labels:
        app: frontarena-ads-aks-test
    spec:
      nodeSelector:
        &quot;beta.kubernetes.io/os&quot;: linux
      restartPolicy: Always
      containers:
      - name: frontarena-ads-aks-test
        image: fa.dev/:test1
        ports:
          - containerPort: 9000
  selector:
    matchLabels:
      app: frontarena-ads-aks-test
---
apiVersion: v1
kind: Service
metadata:
  name: frontarena-ads-aks-test
spec:
  type: ClusterIP
  ports:
  - protocol: TCP
    port: 9000
  selector:
    app: frontarena-ads-aks-test
</code></pre>
<p>I configured and deployed Ingress Controller YAML in same default namespace as well  to connect my Ingress with above Service (I suppose it can connect through it based on the ClusterIP ):</p>
<pre><code>apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: ads-ingress
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/ssl-redirect: &quot;false&quot;
spec:
  rules:
    - http:
        paths:
          - path: /
            backend:
              serviceName: frontarena-ads-aks-test
              servicePort: 9000
</code></pre>
<p>Now this issue is the following:</p>
<p>if I try to target from my VM app deployed outside the AKS cluster in different virtual network with Ingress Controller IP or its DNS name configured by Azure Admins and the Port 9000 - I do not get any response which brings the conclusion that Ingress Controller is  not propagating the network connection to my service which targets the app running on Port 9000 on my Pod.</p>
<p>I can't find the reason why Ingress Controller will not forward the traffic to my service which Targets the Port 9000 which is the Port on which My App Pod is being run.</p>
<p>Thank you!!!</p>

vel
<p>you have only one pod, change the matadata of the deployment to match the metadata of the pod:</p>
<pre><code>....
kind: Deployment
metadata:
  name: frontarena-ads-aks-test
  labels:
    app: frontarena-ads-aks-test
spec:
  replicas: 1
  template:
    metadata:
      name: frontarena-ads-aks-test
      labels:
        app: frontarena-ads-aks-test
....
</code></pre>
