Skip to content

Latest commit

 

History

History
executable file
·
321 lines (248 loc) · 12.3 KB

README-NSX-ALB.md

File metadata and controls

executable file
·
321 lines (248 loc) · 12.3 KB

NSX-ALB (AVI) Controller Setup

Download the software

Download VMware NSX Advanced Load Balancer from the following URL:

https://customerconnect.vmware.com/en/downloads/info/slug/infrastructure_operations_management/vmware_tanzu_kubernetes_grid/1_x

Documentation

  1. VMware NSX Advanced Load Balancer Documentation https://docs.vmware.com/en/VMware-NSX-Advanced-Load-Balancer/index.html

  2. Avi Documentation https://avinetworks.com/docs/

Network Topology

NSX ALB topology - Two Network Configuratio - Separate Management Network, Combined Workload Network and Frontend/VIP Network.

VLAN Configuration
      VLAN ID: 130   VLAN NAME: "tanzu-management"    CIDR: 192.168.130.0/24
      VLAN ID: 131   VLAN NAME: "tanzu-workload"      CIDR: 192.168.131.0/24

NSX ALB Management Network:
      VLAN: tanzu-management
      IP Subnet: 192.168.130.0/24
      Controller IP: 192.168.130.190
      DHCP Range: 192.168.130.50 - 192.168.130.100
      Static IP Address Pool (for SE): 192.168.130.191-192.168.130.199
      [ This range is used to configure the Management Network NIC in the AVI Service Engines.]

NSX ALB Workload/VIP Network:
      VLAN: tanzu-workload
      IP Subnet: 192.168.131.0/24
      DHCP Range (for TKG Nodes): 192.168.131.50 - 192.168.131.100
      Staic IP Address Pool (for VIPs): 192.168.131.151-192.168.131.199 
      [ This range is used by the various Kubernetes control planes and Kubernetes applications that require a Load Balancer Service. ]

Deploy NSX Advanced Load Balancer OVA

  1. Set NSX ALB specs in the configuration 00-tce-build-variables.sh
  2. Run 60-nsx-alb-deploy-avi-ova.sh script to deploy NSX Advanced Load Balancer

Controller Configuration

Power on the Controller VM. Wait 10 minutes and access the Controller IP in the Browser. For the admin username choose a password. Email is optional.

1. Initial Controller Setup [ Wecome Screen ]

  Welocme admin -> System Settings
    Passphrase:
    Confirm Passphrase:
    DNS Resolver(s):   192.168.130.1
    DNS Search Domain:  flexlab.local
    Click [Next]

  Welocme admin -> Email/SMTP
    None
    Click [Next]

  Welcome admin -> Multi-Tenant
    Leave all the defaults  

  Check the [Setup Cloud After] checkbox at the bottom-right of the screen.
  Click [Save]

2. Orchestrator setup [ Infrastructure > Clouds ]

  Select Cloud Tab
    Name: Default-Cloud
    Select Cloud Infrastructure Type
    Orchestrator: VMware vCenter/vSphere ESX 
    Click [Next]

  Infrastructure Tab
    Enter vCenter / vSphere Login information
    Username:
    Password:
    vCenter Address:
    Access Permission: Write
    Click [Next]

  Datacenter tab
    Select Datacenter:  west-dc
    Click [Next]
  
  Network
    Select Management Network
      Management Network: tanzu-management
    Service Engine
      Template Service Engine Group: Default-Group
    IP Address Management for Management Network
      IP Subnet: 192.168.130.0/24
      Default Gateway: 192.168.130.1
      [ This range is used to configure the Management Network NIC in the AVI Service Engines.]
      Add Static IP Address Pool: 192.168.130.191-192.168.130.199 
  
  Click [Save]

3. Set Scope for Service Engines to Specific vSphere Clusters

  Go to: Infrastructure > Cloud Resources (Left) -> Service Engine Group. 
  Select from Default-Cloud -> Default-Group. Clieck the pencil [Edit]

  Choose Advanced Tab
  In the Host & Data Store Scope section
    Select Cluster, Select Include: west-cluster

  Click [Save]

4. Upgrade Controller to latest patch

  Go to: Administration > Controller > Software. 
  Click on Upload from Computer and select the avi-patch pkg file.

5. Switch Licensing Tier to Essentials License (VMware NSX ALB essentials for Tanzu)

  Go to: Administration > Settings > Licensing. 
  Click on the crank wheel next to the Licensing title. Select Essentials License. 
  
  Click [Save]
  Click [Yes,Continue]  

6. Create a Default Gateway route to ensure traffic can flow from SEs to pods

  Create a Default Gateway route to ensure traffic can flow from SEs to pods and back to the clients.
  Go to: Infrastructure -> Cloud Resources -> Routing -> Default-CLoud
  In the Static Route Tab
    Click -> [Create] to create a Static Route
    Gateway Subnet: 0.0.0.0/0
    Next Hop (The Gateway of the VIP Network): 192.168.131.1

  Click [Save]

7. Configure IPAM Profile

  Go to: Templates > Profiles > IPAM/DNS Profiles. 
  Click [Create] to Create IPAM Profile:
    Name: tkg-ipam
    Type: Avi Vantage IPAM
  Click Add Usable Network
    Cloud for Usable Network: Default-Cloud
    Usable Network: tanzu-workload

  Click [Save]

8. Add IPAM Profile to Cloud

   Go to: Infrastructure > Clouds
   Edit the Default-Cloud
    In Infrastructure Tabgo to * IPAM/DNS * section
    Ipam Profile: tkg-ipam

   Click [Save]

9. Create VIP pool

  Go to: Infrastructure > Cloud Resources -> Networks
  Edit the network used in the IPAM Profile configuration [tanzu-workload]
  Edit Network Settings: tanzu-workload
  Click [Add Subnet] to Add/Modify Static IP Subnet
    IP Subnet: 192.168.131.0/24
    Add Static IP Address Pool
       Static IP Address Pool: 192.168.131.151-192.168.131.199
  Click [Save]
  Click [Save]
  
  You should see a simillar configuration:
  NAME               DISCOVERED SUBNET   CONFIGURED SUBNET           STATIC IP POOLS
  tanzu-management   192.168.130.0/24    192.168.130.0/24 [9/9]      1
        IP Subnet (Configured) 192.168.130.0/24 [9/9]
        Static IP Pools (Type)  192.168.130.191 - 192.168.130.199 (SE, VIP)
  
  NAME               DISCOVERED SUBNET   CONFIGURED SUBNET           STATIC IP POOLS
  tanzu-workload     None                192.168.131.0/24 [49/49]    1
        IP Subnet (Configured) 192.168.131.0/24 [49/49]
        Static IP Pools (Type) 192.168.131.151 - 192.168.131.199 (SE, VIP) 

10. Create Custom Certificate for Controller

  Go to: Templates > Security > SSL/TLS Certificates
  Click [Create] to create new a Controller Certificate
    General - Name: controller-certificate
    Certificate - Common Name: 192.168.130.190
    Certificate - Subject Alternate Name (SAN) - Add Name: 192.168.130.190
  Click [Save]

  Go to: Administration > Settings > Access Settings
  Edit System Access Settings
    In the SSL/TLS Certificate - delete all certificates 
          ( Delete System-Default-Portal-Cert )
          ( Delete System-Default-Portal-Cert-EC256 )
    In the SSL/TLS Certificate - add controller-certificate

    Click [Save]

  Restart the browser and accept new controller certificate.

  Go to: Templates > Security > SSL/TLS Certificates
    Select controller-certificate -> clieck Export on the far right
    Copy the Key and the Certificate below:

    KEY: 
-----BEGIN PRI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sxuID3ftn+QXEypJeN69SYtDoAic6M/2
TiQ3vd6XTEBiGX79lqW2KsQzeyzHwu4psYlNEQ4Eo6vwnvIEbkhaGqLyD/llFMm4
W42fZrvqkSg0zZkvM+vV40GSfWQDQfRflz5zM099yDlRv6G+2YVg6Z8QPwIDAQAB
oxMwETAPBgNVHREECDAGhwTAqIK+MA0GCSqGSIb3DQEBCwUAA4IBAQDSXDujiVZt
3u++EDunJMffcczP/2MAPl+htB7VLgPmr9cgfB18YrRNUdvIkIC17bM7Wctm2Ndc
26jxpNykUCBVlJ+DBtU8VOUl02HyRinXDAOFPBUe6wB15gSzGq+8iq45d9OpSTPb
R5IUrmxG26vmYFEHjh+YvzYNj3+A3a81AA5jp0VqJsxqAapMlVMm4UwSb8UJdowC
qA0DYW848uF1SLOZaiKxImU77a3xdDWFyYInrqe5ML4kJcG65RWVtyFb5Ww+EKid
islyU/Qe5tWoEiRPI0jIyjJOcyIOIl2W9pv0/0ozjyGdoePUGdKzSiCr870VvaFN
UmU6H2D54ko/
-----END CERTIFICATE-----

11. Update NSX ALB controller certificate in 00-tkg-build-variables.sh


Create ${HOME}/ova/avi-nsxalb-controller.cert file

## Base64 encode the certificate 
cat << EOF > ${HOME}/ova/avi-nsxalb-controller.cert
-----BEGIN CERTIFICATE-----
MIIC1TCCAb2gAwIBAgIUC1tHEsI1YBvO3hrTs9YogNbhpC8wDQYJKoZIhvcNAQEL
BQAwGjEYMBYGA1UEAwwPMTkyLjE2OC4xMzAuMTkwMB4XDTIyMDIxNjEzMTQ0OFoX
DTIzMDIxNjEzMTQ0OFowGjEYMBYGA1UEAwwPMTkyLjE2OC4xMzAuMTkwMIIBIjAN
BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1aX52PHYOQLsd57wnrWvVh9YAEmZ
anRqU7gnzYsNYahiSHxYao9Zu7jUrOBWIF7+1emVeIXjPKybh/J4CmvmTMhE/xf6
pYtbhPz/2Qqvz2M7H/DXncPGiq89KDAeTN/igS972+3KwCNqX/2mn4CNXqX4tRkU
3BtYrvFKjJjp5NM33JglAgWRz1/R6XmKsxuID3ftn+QXEypJeN69SYtDoAic6M/2
TiQ3vd6XTEBiGX79lqW2KsQzeyzHwu4psYlNEQ4Eo6vwnvIEbkhaGqLyD/llFMm4
W42fZrvqkSg0zZkvM+vV40GSfWQDQfRflz5zM099yDlRv6G+2YVg6Z8QPwIDAQAB
oxMwETAPBgNVHREECDAGhwTAqIK+MA0GCSqGSIb3DQEBCwUAA4IBAQDSXDujiVZt
3u++EDunJMffcczP/2MAPl+htB7VLgPmr9cgfB18YrRNUdvIkIC17bM7Wctm2Ndc
26jxpNykUCBVlJ+DBtU8VOUl02HyRinXDAOFPBUe6wB15gSzGq+8iq45d9OpSTPb
R5IUrmxG26vmYFEHjh+YvzYNj3+A3a81AA5jp0VqJsxqAapMlVMm4UwSb8UJdowC
qA0DYW848uF1SLOZaiKxImU77a3xdDWFyYInrqe5ML4kJcG65RWVtyFb5Ww+EKid
islyU/Qe5tWoEiRPI0jIyjJOcyIOIl2W9pv0/0ozjyGdoePUGdKzSiCr870VvaFN
UmU6H2D54ko/
-----END CERTIFICATE-----
EOF

## Update NSXALB_AVI_CA_DATA_B64 in 00-tkg-build-variables.sh with the certificate string

NSXALB_AVI_CA_DATA_B64=`cat ${HOME}/ova/avi-nsxalb-controller.cert | base64 -w 0`

NSXALB_AVI_CA_DATA_B64="LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUMxVENDQWIyZ0F3SUJBZ0lVQzF0SEVzSTFZQnZPM2hyVHM5WW9nTmJocEM4d0RRWUpLb1pJaHZjTkFRRUwKQlFBd0dqRVlNQllHQTFVRUF3d1BNVGt5TGpFMk9DNHhNekF1TVRrd01CNFhEVEl5TURJeE5qRXpNVFEwT0ZvWApEVEl6TURJeE5qRXpNVFEwT0Zvd0dqRVlNQllHQTFVRUF3d1BNVGt5TGpFMk9DNHhNekF1TVRrd01JSUJJakFOCkJna3Foa2lHOXcwQ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