Openshift with NSX-T Installation Part 5: NCP and CNI Integration
In this article, we will integrate NSX-T NCP and CNI to Openshift.
Step 01: Tag the Logical Switches Ports connected to OCP-Master, OCP-Node01 and OCP-Node02 VMs.
NSX-T Manager -> Switching -> LS-VIFs -> Related -> Ports -> Click on the respective logical ports -> Actions -> Manage Tags
- You can highlight the port to see which VMs is being Connected.
- Scope: ncp/node_name
- Tag: ocp-master
- Scope: ncp/cluster
- Tag: ocp-cl1
- Scope: ncp/node_name
- Tag: ocp-node01
- Scope: ncp/cluster
- Tag: ocp-cl1
- Scope: ncp/node_name
- Tag: ocp-node02
- Scope: ncp/cluster
- Tag: ocp-cl1
Step 02: On the master Node, lets fork the NSX-T Integration for Openshift. The below is using Yasen github, but its a fork from the actual nsxt integration from here -> https://github.com/vmware/nsx-integration-for-openshift.
On every node, run this
cd /root/nsx-container-2.1.3.8356796/Kubernetes
docker load -i nsx-ncp-rhel-2.1.3.8356796.tar
On all the 3 nodes, you have to do the following.
docker images
docker tag registry.local/2.1.3.8356796/nsx-ncp-rhel nsx-ncp
docker images
Then on the master,
cd /root
cd /root/nsx-integration-for-openshift/openshift-ansible-nsx/roles/ncp_prep/defaults/
nano main.yml
change the uplink_port to ens224
# update the variable values below before running the ncp_prep role
cni_url: /root/nsx-container-2.1.3.8356796/Kubernetes/rhel_x86_64/nsx-cni-2.1.3.8356796-1.x86_64.rpm
ovs_url: /root/nsx-container-2.1.3.8356796/OpenvSwitch/rhel74_x86_64/openvswitch-2.8.1.7345072-1.x86_64.rpm
ovs_kmod1_url: /root/nsx-container-2.1.3.8356796/OpenvSwitch/rhel74_x86_64/openvswitch-kmod-2.8.1.7345072-1.el7.x86_64.rpm
ovs_kmod2_url: /root/nsx-container-2.1.3.8356796/OpenvSwitch/rhel74_x86_64/kmod-openvswitch-2.8.1.7345072-1.el7.x86_64.rpm
uplink_port: ens224
ncp_image_url: /root/nsx-container-2.1.3.8356796/Kubernetes/nsx-ncp-rhel-2.1.3.8356796.tar
cni_url: /root/nsx-container-2.1.3.8356796/Kubernetes/rhel_x86_64/nsx-cni-2.1.3.8356796-1.x86_64.rpm
ovs_url: /root/nsx-container-2.1.3.8356796/OpenvSwitch/rhel74_x86_64/openvswitch-2.8.1.7345072-1.x86_64.rpm
ovs_kmod1_url: /root/nsx-container-2.1.3.8356796/OpenvSwitch/rhel74_x86_64/openvswitch-kmod-2.8.1.7345072-1.el7.x86_64.rpm
ovs_kmod2_url: /root/nsx-container-2.1.3.8356796/OpenvSwitch/rhel74_x86_64/kmod-openvswitch-2.8.1.7345072-1.el7.x86_64.rpm
uplink_port: ens224
ncp_image_url: /root/nsx-container-2.1.3.8356796/Kubernetes/nsx-ncp-rhel-2.1.3.8356796.tar
cd /root
nano /root/ncp-rc.yml
subnet_prefix = 24
tier0_router = T0
overlay_tz = TZ-Overlay
container_ip_blocks = IPBlock-PodNetworking
no_snat_ip_blocks = IPBlock-NONAT
external_ip_pools = Pool-NAT
top_firewall_section_marker = top_firewall_section
bottom_firewall_section_marker = bottom_firewall_section
overlay_tz = TZ-Overlay
container_ip_blocks = IPBlock-PodNetworking
no_snat_ip_blocks = IPBlock-NONAT
external_ip_pools = Pool-NAT
top_firewall_section_marker = top_firewall_section
bottom_firewall_section_marker = bottom_firewall_section
oc apply -f ncp-rc.yml
cd /root/nsx-integration-for-openshift/openshift-ansible-nsx/roles/ncp/defaults
change the apiserver_host_ip, nsx_manager_ip, nsx_api_user and nsx_api_password to your configuration.
ncp_yaml_url: /root/ncp-rc.yml
agent_yaml_url: http://52.59.159.238/nsx-node-agent-ds.yml
cluster_name: ocp-cl1
apiserver_host_ip: 10.11.1.10
nsx_manager_ip: 10.136.1.102
nsx_api_user: admin
nsx_api_password: VMware1!
agent_yaml_url: http://52.59.159.238/nsx-node-agent-ds.yml
cluster_name: ocp-cl1
apiserver_host_ip: 10.11.1.10
nsx_manager_ip: 10.136.1.102
nsx_api_user: admin
nsx_api_password: VMware1!
ansible-playbook /root/nsx-integration-for-openshift/openshift-ansible-nsx/ncp.yaml
oc get pod
oc delete nsx-ncp-r46z2