How to create loadbalancer (IAAS) in Azure for Kubernetes Ingress controller

7/23/2018

I created Kubernetes cluster using ACS-engine in Azure and installed Ingress controller.

I deployed a service:

  • Inside the cluster running the command curl :/myservice give the expected response.

I created a VM with NGinx in order to get external access and using the external IP of the VM such external access to the service exists.

My Goal:

  • Replace the VM with Azure IAAS Loadbalancer.

Steps that i did using the UI:

  1. Click Create resources -> Create public IP address -> set name of the IP -> set assignment Static -> define the resource group.

  2. Click create resources -> Networking -> Load Balancer -> select the publicip that created in step #1 -> Use the same resource group.

  3. Created Health probe -> protocol HTTP, port 32597 (Ingress port) and path /myservice

  4. Defined the backend pool to the Availabilityset of the Kubernetes nodes (agents).

  5. Created Inbound NAT rule: Service: Custom. Port: 32597. Availabilityset: Kubernetes nodes (agents)

Unlike the VM i cannot reach the website and i do not see in the Loadbalncer logs any information.

Questions:

  1. How to get the traffic logs ?
  2. Can i run TCPDUMP ?
  3. How to fix the issue ?

Thank you.

-- Oron Golan
azure
azure-load-balancer
kubernetes

1 Answer

7/24/2018

As I know, if you want to reach the website in Azure Kubernets Cluster through Load Balancer, you should set Load Balancer rules, not NAT rules. And the rules screenshot here. enter image description here

How to get the traffic logs ?

You can use the command kubectl logs azure-vote-front-7976b7dcd9-m7445 like this to get the pods logs. You can get more details from kubectl logs podName. And the test screenshot here. enter image description here

Can i run TCPDUMP ?

If you want to run TCPDUMP in the Kubernets node, you can ssh into the node and run TCPDUMP with the root permission. And the test screenshot here. enter image description here

For your third question, you can follow the suggestion which I say at the beginning.

-- Charles Xu
Source: StackOverflow