Answers: <p>you add the server to balancer then create NAT rule to forward the packet to specific port on your VM.</p>
  <p><a href="https://argonsys.com/microsoft-cloud/library/manage-port-forwarding-for-backend-pool-with-azure-load-balancer/" rel="nofollow noreferrer">manage-port-forwarding-for-backend-pool-with-azure-load-balancer</a></p>
  
Answers: CC BY-SA 4.0
Answers: 2022-06-17T06:07:01.010Z
Answers: somehow only got it working with the public ip address set to static. but hey it works
Answers: Serve Laurijssen
Answers: CC BY-SA 4.0
Answers: 2022-06-13T03:29:53.770Z
Answers: 2022-06-13T03:29:53.770Z
Answers: Iyus Dedi Putra
Body: <p>Consider this:</p>
  <p>There's a linux machine running on azure.</p>
  <p>It has apache installed and browing to mymachine.com works, webpage is displayed. All ports are opened in the azure portal &quot;networking settings&quot;.</p>
  <p>Now there's a k8s kind cluster running on the machine too with a rabbitmq deployment as NodePort service port 32254.</p>
  <pre><code>kubectl get svc
  </code></pre>
  <ul>
  <li>kubernetes       ClusterIP   10.96.0.1              443/TCP  3h17m</li>
  <li>ng ClusterIP   10.96.104.61           80/TCP 68m</li>
  <li>rabbitmq         NodePort    10.96.8.15             5672:32740/TCP,15672:32254/TCP,15692:31802/TCP   143m</li>
  <li>rabbitmq-nodes   ClusterIP   None                   4369/TCP,25672/TCP 143m</li>
  </ul>
  <p>All good, but I'm unable to access the rabbitmq cluster from outside.</p>
  <p>The ip address of the control plane is 172.18.0.3, so this command works:</p>
  <pre><code>curl http://172.18.0.3:32254
  </code></pre>
  <p>But connecting from outside does not work:</p>
  <pre><code>curl http://mymachine.com:32254 
  </code></pre>
  <p>So how do we forward from the public-ip of a VM in azure to an internal IP inside the VM?</p>
  
Tags: <kubernetes><azure><azure-kubernetes-service>
Title: connect to kind cluster from inside and outside
UserDisplayName: Serve Laurijssen
ThreadText: # connect to kind cluster from inside and outside
  
  (Asked by: username_0 on 2022-06-10)
  
  Consider this:
  
  There's a linux machine running on azure.
  
  It has apache installed and browing to mymachine.com works, webpage is displayed. All ports are opened in the azure portal "networking settings".
  
  Now there's a k8s kind cluster running on the machine too with a rabbitmq deployment as NodePort service port 32254.
  
  ```
  kubectl get svc
  
  ```
  
  * kubernetes ClusterIP 10.96.0.1 443/TCP 3h17m
  * ng ClusterIP 10.96.104.61 80/TCP 68m
  * rabbitmq NodePort 10.96.8.15 5672:32740/TCP,15672:32254/TCP,15692:31802/TCP 143m
  * rabbitmq-nodes ClusterIP None 4369/TCP,25672/TCP 143m
  
  All good, but I'm unable to access the rabbitmq cluster from outside.
  
  The ip address of the control plane is 172.18.0.3, so this command works:
  
  ```
  curl http://172.18.0.3:32254
  
  ```
  
  But connecting from outside does not work:
  
  ```
  curl http://mymachine.com:32254 
  
  ```
  
  So how do we forward from the public-ip of a VM in azure to an internal IP inside the VM?
  
  **Tags:** kubernetes, azure, azure-kubernetes-service
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-06-13. Score: 1 | Accepted answer
  
  you add the server to balancer then create NAT rule to forward the packet to specific port on your VM.
  
  [manage-port-forwarding-for-backend-pool-with-azure-load-balancer](https://argonsys.com/microsoft-cloud/library/manage-port-forwarding-for-backend-pool-with-azure-load-balancer/)
  
  > **Comments:**
  > **username_0**: somehow only got it working with the public ip address set to static. but hey it works  
  
  ---
  
  