1. Begin by creating two target groups for the TCP protocol, one regarding TCP port 443 and one regarding TCP port 80 (providing redirect to TCP port 443). You’ll add your Linux nodes to these groups.

  2. Register Targets

    Add your Linux nodes to the target groups.

  3. Use Amazon’s Wizard to create an Network Load Balancer. As part of this process, you’ll add the target groups you created in 1. Create Target Groups.

Your first NLB configuration step is to create two target groups. Technically, only port 443 is needed to access Rancher, but its convenient to add a listener for port 80 which will be redirected to port 443 automatically. The NGINX ingress controller on the nodes will make sure that port 80 gets redirected to port 443.

Log into the Amazon AWS Console to get started, make sure to select the Region where your EC2 instances (Linux nodes) are created.

The Target Groups configuration resides in the Load Balancing section of the EC2 service. Select Services and choose EC2, find the section Load Balancing and open Target Groups.

Click Create target group to create the first target group, regarding TCP port 443.

Configure the first target group according to the table below. Screenshots of the configuration are shown just below the table.


Screenshot Target group TCP port 443 settings
Target group 443


Screenshot Target group TCP port 443 Advanced settings


Click Create target group to create the second target group, regarding TCP port 80.

Target Group (TCP port 80)

Configure the second target group according to the table below. Screenshots of the configuration are shown just below the table.

OptionSetting
Target Group Namerancher-tcp-80
ProtocolTCP
Port80
Target typeinstance
VPCChoose your VPC
Protocol
(Health Check)
HTTP
Path
(Health Check)
/healthz
Port (Advanced health check)traffic port
Healthy threshold (Advanced health)3
Unhealthy threshold (Advanced)3
Timeout (Advanced)6 seconds
Interval (Advanced)10 second
Success codes


Screenshot Target group TCP port 80 Advanced settings
Target group 80 Advanced


Next, add your Linux nodes to both target groups.

Select the target group named rancher-tcp-443, click the tab Targets and choose Edit.

Select the instances (Linux nodes) you want to add, and click Add to registered.


Screenshot Add targets to target group TCP port 443

Add targets to target group 443


Screenshot Added targets to target group TCP port 443

When the instances are added, click Save on the bottom right of the screen.

Repeat those steps, replacing rancher-tcp-443 with rancher-tcp-80. The same instances need to be added as targets to this target group.

Use Amazon’s Wizard to create an Network Load Balancer. As part of this process, you’ll add the target groups you created in Create Target Groups.

  1. From your web browser, navigate to the .

  2. Click Create Load Balancer.

  3. Choose Network Load Balancer and click Create.

  4. Complete the Step 1: Configure Load Balancer form.

      • Name: rancher
      • Scheme: internal or internet-facing

      The Scheme that you choose for your NLB is dependent on the configuration of your instances/VPC. If your instances do not have public IPs associated with them, or you will only be accessing Rancher internally, you should set your NLB Scheme to internal rather than internet-facing.

    • Listeners

      Add the Load Balancer Protocols and Load Balancer Ports below.

      • TCP: 443
    • Availability Zones

      • Select Your VPC and Availability Zones.
  5. Complete Step 3: Register Targets. Since you registered your targets earlier, all you have to do is click Next: Review.

  6. Complete Step 4: Review. Look over the load balancer details and click Create when you’re satisfied.

  7. After AWS creates the NLB, click Close.

  1. Select your newly created NLB and select the Listeners tab.

  2. Click Add listener.

  3. Use TCP:80 as Protocol : Port

  4. Click Add action and choose Forward to…

  5. Click Save in the top right of the screen.