Fix network for cicd-bm-k8s model

Latest changes:
Restore segregated networks config

Changes:
Fix k8s manager
Change valid interface for vhost
Segregation tenant and control nets
Fix prx nodes config

Change-Id: Ibec7fdb70fac37a6ac7361f4774f0250eceb28b3
diff --git a/tcp_tests/managers/k8smanager.py b/tcp_tests/managers/k8smanager.py
index 5b43254..759e716 100644
--- a/tcp_tests/managers/k8smanager.py
+++ b/tcp_tests/managers/k8smanager.py
@@ -105,10 +105,16 @@
         return [self.__underlay.host_by_node_name(node_name=v)
                 for pillar in masters_fqdn for k, v in pillar.items()]
 
+    def get_masters_name(self):
+        """ Return list of kubernetes masters hosts fqdn """
+        masters_fqdn = self._salt.get_pillar(
+            tgt='I@kubernetes:master', pillar='linux:network:fqdn')
+        return [v for pillar in masters_fqdn for k, v in pillar.items()]
+
     @property
     def controller_name(self):
         """ Return node name of controller node that used for all actions """
-        names = [node['node_name'] for node in self.get_controllers()]
+        names = [node for node in self.get_masters_name()]
         # we want to return same controller name every time
         names.sort()
         return names[0]
diff --git a/tcp_tests/templates/cookied-cicd-bm-k8s-contrail40-maas/lab04-physical-inventory.yaml b/tcp_tests/templates/cookied-cicd-bm-k8s-contrail40-maas/lab04-physical-inventory.yaml
index d51f4b6..67b5df4 100644
--- a/tcp_tests/templates/cookied-cicd-bm-k8s-contrail40-maas/lab04-physical-inventory.yaml
+++ b/tcp_tests/templates/cookied-cicd-bm-k8s-contrail40-maas/lab04-physical-inventory.yaml
@@ -18,11 +18,9 @@
       - linux_system_codename_xenial

       interfaces:

         enp9s0f0:

-          role: single_dhcp

+          role: single_mgm_dhcp

         enp9s0f1:

           role: single_vlan_ctl

-        ens11f0:

-          role: single_mgm_manual_vlan

 

     kvm02.cookied-cicd-bm-k8s-contrail40-maas.local:

       reclass_storage_name: infra_kvm_node02

@@ -31,11 +29,9 @@
       - linux_system_codename_xenial

       interfaces:

         enp9s0f0:

-          role: single_dhcp

+          role: single_mgm_dhcp

         enp9s0f1:

           role: single_vlan_ctl

-        ens11f0:

-          role: single_mgm_manual_vlan

 

     kvm03.cookied-cicd-bm-k8s-contrail40-maas.local:

       reclass_storage_name: infra_kvm_node03

@@ -44,11 +40,9 @@
       - linux_system_codename_xenial

       interfaces:

         enp9s0f0:

-          role: single_dhcp

+          role: single_mgm_dhcp

         enp9s0f1:

           role: single_vlan_ctl

-        ens11f0:

-          role: single_mgm_manual_vlan

 

     ctl01.cookied-cicd-bm-k8s-contrail40-maas.local:

       reclass_storage_name: kubernetes_control_node01

@@ -92,5 +86,7 @@
       interfaces:

         enp9s0f0:

           role: single_dhcp

+        enp9s0f1:

+          role: single_vlan_ctl

         ens11f1:

-          role: k8s_oc40_only_vhost_on_control_vlan

+          role: bond0_ab_contrail

diff --git a/tcp_tests/templates/cookied-cicd-bm-k8s-contrail40-maas/salt-context-cookiecutter-k8s-contrail.yaml b/tcp_tests/templates/cookied-cicd-bm-k8s-contrail40-maas/salt-context-cookiecutter-k8s-contrail.yaml
index e2bbdb7..5e6f6f4 100644
--- a/tcp_tests/templates/cookied-cicd-bm-k8s-contrail40-maas/salt-context-cookiecutter-k8s-contrail.yaml
+++ b/tcp_tests/templates/cookied-cicd-bm-k8s-contrail40-maas/salt-context-cookiecutter-k8s-contrail.yaml
@@ -106,11 +106,12 @@
   infra_kvm_vip_address: 10.167.13.240
   infra_primary_first_nic: eth1
   infra_primary_second_nic: eth2
+  internal_proxy_enabled: 'False'
   kubernetes_enabled: 'True'
   kubernetes_compute_count: 2
   kubernetes_compute_rack01_hostname: cmp
   kubernetes_compute_single_address_ranges: 10.167.13.103-10.167.13.104
-  kubernetes_compute_tenant_address_ranges: 10.167.13.103-10.167.13.104
+  kubernetes_compute_tenant_address_ranges: 10.167.14.103-10.167.14.104
   kubernetes_network_opencontrail_enabled: 'True'
   kubernetes_keepalived_vip_interface: br_ctl
   kubernetes_metallb_enabled: 'False'  # Not used with opencontrail
@@ -273,6 +274,12 @@
   kubernetes_control_node02_deploy_address: 172.17.41.11
   kubernetes_control_node03_address: 10.167.13.237
   kubernetes_control_node03_hostname: ctl03
+  kubernetes_proxy_hostname: prx
+  kubernetes_proxy_node01_hostname: prx01
+  kubernetes_proxy_node02_hostname: prx02
+  kubernetes_proxy_address: 10.167.13.80
+  kubernetes_proxy_node01_address: 10.167.13.81
+  kubernetes_proxy_node02_address: 10.167.13.82
   linux_repo_contrail_component: oc40
   opencontrail_analytics_hostname: ctl
   opencontrail_analytics_node01_hostname: ctl01
@@ -293,9 +300,9 @@
   opencontrail_control_node03_address: 10.167.13.237
   opencontrail_control_node03_hostname: ctl03
   opencontrail_enabled: 'True'
-  opencontrail_router01_address: 10.167.13.100
+  opencontrail_router01_address: 10.167.13.220
   opencontrail_router01_hostname: rtr01
-  opencontrail_router02_address: 10.167.13.101
+  opencontrail_router02_address: 10.167.13.221
   opencontrail_router02_hostname: rtr02
   opencontrail_public_ip_range: 172.17.41.128/26
   opencontrail_version: '4.0'
@@ -351,10 +358,10 @@
   stacklight_telemetry_node03_hostname: mtr03
   stacklight_version: '2'
   static_ips_on_deploy_network_enabled: 'False'
-  tenant_network_gateway: 10.167.13.1
+  tenant_network_gateway: 10.167.14.253
   tenant_network_netmask: 255.255.255.0
-  tenant_network_subnet: 10.167.13.0/24
-  tenant_vlan: '2410'
+  tenant_network_subnet: 10.167.14.0/24
+  tenant_vlan: '2411'
   upstream_proxy_enabled: 'False'
   use_default_network_scheme: 'True'
   vnf_onboarding_enabled: 'False'
diff --git a/tcp_tests/templates/cookied-cicd-bm-k8s-contrail40-maas/salt-context-environment.yaml b/tcp_tests/templates/cookied-cicd-bm-k8s-contrail40-maas/salt-context-environment.yaml
index 5ef4e1b..e9a7dda 100644
--- a/tcp_tests/templates/cookied-cicd-bm-k8s-contrail40-maas/salt-context-environment.yaml
+++ b/tcp_tests/templates/cookied-cicd-bm-k8s-contrail40-maas/salt-context-environment.yaml
@@ -130,3 +130,25 @@
           role: single_dhcp

         ens3:

           role: single_ctl

+

+    prx01:

+      reclass_storage_name: kubernetes_proxy_node01

+      roles:

+      - kubernetes_proxy

+      - linux_system_codename_xenial

+      interfaces:

+        ens2:

+          role: single_dhcp

+        ens3:

+          role: single_ctl

+

+    prx02:

+      reclass_storage_name: kubernetes_proxy_node02

+      roles:

+      - kubernetes_proxy

+      - linux_system_codename_xenial

+      interfaces:

+        ens2:

+          role: single_dhcp

+        ens3:

+          role: single_ctl