Add k8s ingress and metallb features

- enable ingress-nginx and metallb features
  for the configurations:
  - cookiecutter-context-k8s-sl
  - cookied-cicd-k8s-genie
  - cookied-bm-k8s-contrail

- add 'external' network on cfg, ctl, cmp and prx nodes

- enable DHCP in 'external' network for auto configuration
  of the external interfaces

- get the status of the ingress and metallb features from
  the salt pillar instead of environment variables to
  run the tests on the existing deployments

Related-Task: PROD-22687
Closes-Bug: PROD-24580

Change-Id: Ifee60814718abc604008af5e2058a6db1bf92d6d
diff --git a/tcp_tests/templates/cookied-bm-k8s-contrail/salt-context-cookiecutter-k8s-contrail.yaml b/tcp_tests/templates/cookied-bm-k8s-contrail/salt-context-cookiecutter-k8s-contrail.yaml
index 570000a..9e62bbf 100644
--- a/tcp_tests/templates/cookied-bm-k8s-contrail/salt-context-cookiecutter-k8s-contrail.yaml
+++ b/tcp_tests/templates/cookied-bm-k8s-contrail/salt-context-cookiecutter-k8s-contrail.yaml
@@ -111,6 +111,10 @@
   kubernetes_compute_single_address_ranges: 10.167.8.103-10.167.8.104
   kubernetes_compute_tenant_address_ranges: 10.167.8.103-10.167.8.104
   kubernetes_network_opencontrail_enabled: 'True'
+  kubernetes_metallb_enabled: 'False'  # Not used with opencontrail
+  metallb_addresses: 172.17.41.160-172.17.41.180
+  kubernetes_ingressnginx_enabled: 'True'
+  kubernetes_ingressnginx_controller_replicas: 2
   local_repositories: 'False'
   maas_deploy_address: 172.16.49.66
   maas_deploy_range_end: 10.0.0.254
diff --git a/tcp_tests/templates/cookied-cicd-k8s-calico-sl/cookiecutter-context-k8s-sl.yaml b/tcp_tests/templates/cookied-cicd-k8s-calico-sl/cookiecutter-context-k8s-sl.yaml
index e27cc19..061b4db 100644
--- a/tcp_tests/templates/cookied-cicd-k8s-calico-sl/cookiecutter-context-k8s-sl.yaml
+++ b/tcp_tests/templates/cookied-cicd-k8s-calico-sl/cookiecutter-context-k8s-sl.yaml
@@ -135,6 +135,10 @@
   kubernetes_proxy_address: 10.167.4.220
   kubernetes_proxy_node01_address: 10.167.4.221
   kubernetes_proxy_node02_address: 10.167.4.222
+  kubernetes_metallb_enabled: 'True'
+  metallb_addresses: 172.17.16.150-172.17.16.190
+  kubernetes_ingressnginx_enabled: 'True'
+  kubernetes_ingressnginx_controller_replicas: 2
   local_repositories: 'False'
   maas_deploy_address: 10.167.5.15
   maas_deploy_range_end: 10.167.5.199
diff --git a/tcp_tests/templates/cookied-cicd-k8s-calico-sl/environment-context-k8s-sl.yaml b/tcp_tests/templates/cookied-cicd-k8s-calico-sl/environment-context-k8s-sl.yaml
index 2d4689c..4abe271 100644
--- a/tcp_tests/templates/cookied-cicd-k8s-calico-sl/environment-context-k8s-sl.yaml
+++ b/tcp_tests/templates/cookied-cicd-k8s-calico-sl/environment-context-k8s-sl.yaml
@@ -9,6 +9,8 @@
           role: single_dhcp
         ens4:
           role: single_static_ctl
+        ens5:
+          role: single_storage_dhcp
 
     kvm01:
       reclass_storage_name: infra_kvm_node01
@@ -86,6 +88,8 @@
           role: single_dhcp
         ens4:
           role: single_ctl_calico
+        ens5:
+          role: single_storage_dhcp
 
     ctl02:
       reclass_storage_name: kubernetes_control_node02
@@ -97,6 +101,8 @@
           role: single_dhcp
         ens4:
           role: single_ctl_calico
+        ens5:
+          role: single_storage_dhcp
 
     ctl03:
       reclass_storage_name: kubernetes_control_node03
@@ -108,6 +114,8 @@
           role: single_dhcp
         ens4:
           role: single_ctl_calico
+        ens5:
+          role: single_storage_dhcp
 
     prx01:
       reclass_storage_name: kubernetes_proxy_node01
@@ -119,6 +127,8 @@
           role: single_dhcp
         ens4:
           role: single_ctl
+        ens5:
+          role: single_storage_dhcp
 
     prx02:
       reclass_storage_name: kubernetes_proxy_node02
@@ -130,6 +140,8 @@
           role: single_dhcp
         ens4:
           role: single_ctl
+        ens5:
+          role: single_storage_dhcp
 
     # Generator-based computes. For compatibility only
     cmp<<count>>:
@@ -143,6 +155,8 @@
           role: single_dhcp
         ens4:
           role: single_ctl_calico
+        ens5:
+          role: single_storage_dhcp
 
     mon01:
       reclass_storage_name: stacklight_server_node01
diff --git a/tcp_tests/templates/cookied-cicd-k8s-calico-sl/underlay.yaml b/tcp_tests/templates/cookied-cicd-k8s-calico-sl/underlay.yaml
index 6f69b81..132a382 100644
--- a/tcp_tests/templates/cookied-cicd-k8s-calico-sl/underlay.yaml
+++ b/tcp_tests/templates/cookied-cicd-k8s-calico-sl/underlay.yaml
@@ -135,6 +135,13 @@
             default_{{ HOSTNAME_CID01 }}: +91
             default_{{ HOSTNAME_CID02 }}: +92
             default_{{ HOSTNAME_CID03 }}: +93
+            default_{{ HOSTNAME_CTL01 }}: +11
+            default_{{ HOSTNAME_CTL02 }}: +12
+            default_{{ HOSTNAME_CTL03 }}: +13
+            default_{{ HOSTNAME_CMP01 }}: +101
+            default_{{ HOSTNAME_CMP02 }}: +102
+            default_{{ HOSTNAME_CMP03 }}: +103
+            default_{{ HOSTNAME_CMP04 }}: +104
             default_{{ HOSTNAME_PRX01 }}: +221
             default_{{ HOSTNAME_PRX02 }}: +222
 
@@ -176,7 +183,7 @@
 
           external:
             address_pool: external-pool01
-            dhcp: false
+            dhcp: true
             forward:
               mode: nat
 
@@ -212,20 +219,26 @@
                   bus: ide
                   # source_image: !os_env CFG01_CONFIG_PATH # no source image required.
                                                             # it will be uploaded after config drive generation
-              interfaces:
+              interfaces: &all_interfaces
                 - label: ens3
                   l2_network_device: admin
                   interface_model: *interface_model
                 - label: ens4
                   l2_network_device: private
                   interface_model: *interface_model
-              network_config:
+                - label: ens5
+                  l2_network_device: external
+                  interface_model: *interface_model
+              network_config: &all_network_config
                 ens3:
                   networks:
                     - admin
                 ens4:
                   networks:
                     - private
+                ens5:
+                  networks:
+                    - external
 
           - name: {{ HOSTNAME_KVM01 }}
             role: salt_minion
@@ -418,8 +431,8 @@
                   cloudinit_meta_data: *cloudinit_meta_data
                   cloudinit_user_data: *cloudinit_user_data_1604
 
-              interfaces: *interfaces
-              network_config: *network_config
+              interfaces: *all_interfaces
+              network_config: *all_network_config
 
           - name: {{ HOSTNAME_CTL02 }}
             role: salt_minion
@@ -444,8 +457,8 @@
                   cloudinit_meta_data: *cloudinit_meta_data
                   cloudinit_user_data: *cloudinit_user_data_1604
 
-              interfaces: *interfaces
-              network_config: *network_config
+              interfaces: *all_interfaces
+              network_config: *all_network_config
 
           - name: {{ HOSTNAME_CTL03 }}
             role: salt_minion
@@ -470,8 +483,8 @@
                   cloudinit_meta_data: *cloudinit_meta_data
                   cloudinit_user_data: *cloudinit_user_data_1604
 
-              interfaces: *interfaces
-              network_config: *network_config
+              interfaces: *all_interfaces
+              network_config: *all_network_config
 
           - name: {{ HOSTNAME_CMP01 }}
             role: salt_minion
@@ -496,8 +509,8 @@
                   cloudinit_meta_data: *cloudinit_meta_data
                   cloudinit_user_data: *cloudinit_user_data_1604
 
-              interfaces: *interfaces
-              network_config: *network_config
+              interfaces: *all_interfaces
+              network_config: *all_network_config
 
           - name: {{ HOSTNAME_CMP02 }}
             role: salt_minion
@@ -522,8 +535,8 @@
                   cloudinit_meta_data: *cloudinit_meta_data
                   cloudinit_user_data: *cloudinit_user_data_1604
 
-              interfaces: *interfaces
-              network_config: *network_config
+              interfaces: *all_interfaces
+              network_config: *all_network_config
 
           - name: {{ HOSTNAME_CMP03 }}
             role: salt_minion
@@ -548,8 +561,8 @@
                   cloudinit_meta_data: *cloudinit_meta_data
                   cloudinit_user_data: *cloudinit_user_data_1604
 
-              interfaces: *interfaces
-              network_config: *network_config
+              interfaces: *all_interfaces
+              network_config: *all_network_config
 
           - name: {{ HOSTNAME_CMP04 }}
             role: salt_minion
@@ -574,8 +587,8 @@
                   cloudinit_meta_data: *cloudinit_meta_data
                   cloudinit_user_data: *cloudinit_user_data_1604
 
-              interfaces: *interfaces
-              network_config: *network_config
+              interfaces: *all_interfaces
+              network_config: *all_network_config
 
           - name: {{ HOSTNAME_MON01 }}
             role: salt_minion
@@ -834,8 +847,8 @@
                   cloudinit_meta_data: *cloudinit_meta_data
                   cloudinit_user_data: *cloudinit_user_data_1604_swp
 
-              interfaces: *interfaces
-              network_config: *network_config
+              interfaces: *all_interfaces
+              network_config: *all_network_config
 
           - name: {{ HOSTNAME_PRX02 }}
             role: salt_minion
@@ -860,5 +873,5 @@
                   cloudinit_meta_data: *cloudinit_meta_data
                   cloudinit_user_data: *cloudinit_user_data_1604_swp
 
-              interfaces: *interfaces
-              network_config: *network_config
+              interfaces: *all_interfaces
+              network_config: *all_network_config
diff --git a/tcp_tests/templates/cookied-cicd-k8s-genie/cookiecutter-context-k8s-genie.yaml b/tcp_tests/templates/cookied-cicd-k8s-genie/cookiecutter-context-k8s-genie.yaml
index e163fec..7352614 100644
--- a/tcp_tests/templates/cookied-cicd-k8s-genie/cookiecutter-context-k8s-genie.yaml
+++ b/tcp_tests/templates/cookied-cicd-k8s-genie/cookiecutter-context-k8s-genie.yaml
@@ -134,6 +134,10 @@
   kubernetes_proxy_address: 10.167.4.220
   kubernetes_proxy_node01_address: 10.167.4.221
   kubernetes_proxy_node02_address: 10.167.4.222
+  kubernetes_metallb_enabled: 'True'
+  metallb_addresses: 172.17.16.150-172.17.16.190
+  kubernetes_ingressnginx_enabled: 'True'
+  kubernetes_ingressnginx_controller_replicas: 2
   local_repositories: 'False'
   maas_deploy_address: 10.167.5.15
   maas_deploy_range_end: 10.167.5.199
@@ -180,5 +184,3 @@
   kubernetes_network_genie_enabled: 'True'
   kubernetes_genie_default_plugin: 'calico'
   kubernetes_virtlet_enabled: 'True'
-  kubernetes_compute_node01_hostname: cmp001
-  kubernetes_compute_node02_hostname: cmp002
diff --git a/tcp_tests/templates/cookied-cicd-k8s-genie/environment-context-k8s-genie.yaml b/tcp_tests/templates/cookied-cicd-k8s-genie/environment-context-k8s-genie.yaml
index d13627b..807d07f 100644
--- a/tcp_tests/templates/cookied-cicd-k8s-genie/environment-context-k8s-genie.yaml
+++ b/tcp_tests/templates/cookied-cicd-k8s-genie/environment-context-k8s-genie.yaml
@@ -9,6 +9,8 @@
           role: single_dhcp
         ens4:
           role: single_static_ctl
+        ens5:
+          role: single_storage_dhcp
 
     kvm01:
       reclass_storage_name: infra_kvm_node01
@@ -86,6 +88,8 @@
           role: single_dhcp
         ens4:
           role: single_ctl_calico
+        ens5:
+          role: single_storage_dhcp
 
     ctl02:
       reclass_storage_name: kubernetes_control_node02
@@ -97,6 +101,8 @@
           role: single_dhcp
         ens4:
           role: single_ctl_calico
+        ens5:
+          role: single_storage_dhcp
 
     ctl03:
       reclass_storage_name: kubernetes_control_node03
@@ -108,6 +114,8 @@
           role: single_dhcp
         ens4:
           role: single_ctl_calico
+        ens5:
+          role: single_storage_dhcp
 
     prx01:
       reclass_storage_name: kubernetes_proxy_node01
@@ -119,6 +127,8 @@
           role: single_dhcp
         ens4:
           role: single_ctl
+        ens5:
+          role: single_storage_dhcp
 
     prx02:
       reclass_storage_name: kubernetes_proxy_node02
@@ -130,6 +140,8 @@
           role: single_dhcp
         ens4:
           role: single_ctl
+        ens5:
+          role: single_storage_dhcp
 
     # Generator-based computes. For compatibility only
     cmp<<count>>:
@@ -143,3 +155,5 @@
           role: single_dhcp
         ens4:
           role: single_ctl_calico
+        ens5:
+          role: single_storage_dhcp
diff --git a/tcp_tests/templates/cookied-cicd-k8s-genie/underlay.yaml b/tcp_tests/templates/cookied-cicd-k8s-genie/underlay.yaml
index 3211906..ee69506 100644
--- a/tcp_tests/templates/cookied-cicd-k8s-genie/underlay.yaml
+++ b/tcp_tests/templates/cookied-cicd-k8s-genie/underlay.yaml
@@ -114,6 +114,13 @@
             default_{{ HOSTNAME_CID01 }}: +91
             default_{{ HOSTNAME_CID02 }}: +92
             default_{{ HOSTNAME_CID03 }}: +93
+            default_{{ HOSTNAME_CTL01 }}: +11
+            default_{{ HOSTNAME_CTL02 }}: +12
+            default_{{ HOSTNAME_CTL03 }}: +13
+            default_{{ HOSTNAME_CMP01 }}: +101
+            default_{{ HOSTNAME_CMP02 }}: +102
+            default_{{ HOSTNAME_CMP03 }}: +103
+            default_{{ HOSTNAME_CMP04 }}: +104
             default_{{ HOSTNAME_PRX01 }}: +221
             default_{{ HOSTNAME_PRX02 }}: +222
 
@@ -155,7 +162,7 @@
 
           external:
             address_pool: external-pool01
-            dhcp: false
+            dhcp: true
             forward:
               mode: nat
 
@@ -191,20 +198,26 @@
                   bus: ide
                   # source_image: !os_env CFG01_CONFIG_PATH # no source image required.
                                                             # it will be uploaded after config drive generation
-              interfaces:
+              interfaces: &all_interfaces
                 - label: ens3
                   l2_network_device: admin
                   interface_model: *interface_model
                 - label: ens4
                   l2_network_device: private
                   interface_model: *interface_model
-              network_config:
+                - label: ens5
+                  l2_network_device: external
+                  interface_model: *interface_model
+              network_config: &all_network_config
                 ens3:
                   networks:
                     - admin
                 ens4:
                   networks:
                     - private
+                ens5:
+                  networks:
+                    - external
 
           - name: {{ HOSTNAME_KVM01 }}
             role: salt_minion
@@ -397,8 +410,8 @@
                   cloudinit_meta_data: *cloudinit_meta_data
                   cloudinit_user_data: *cloudinit_user_data_1604
 
-              interfaces: *interfaces
-              network_config: *network_config
+              interfaces: *all_interfaces
+              network_config: *all_network_config
 
           - name: {{ HOSTNAME_CTL02 }}
             role: salt_minion
@@ -423,8 +436,8 @@
                   cloudinit_meta_data: *cloudinit_meta_data
                   cloudinit_user_data: *cloudinit_user_data_1604
 
-              interfaces: *interfaces
-              network_config: *network_config
+              interfaces: *all_interfaces
+              network_config: *all_network_config
 
           - name: {{ HOSTNAME_CTL03 }}
             role: salt_minion
@@ -449,8 +462,8 @@
                   cloudinit_meta_data: *cloudinit_meta_data
                   cloudinit_user_data: *cloudinit_user_data_1604
 
-              interfaces: *interfaces
-              network_config: *network_config
+              interfaces: *all_interfaces
+              network_config: *all_network_config
 
           - name: {{ HOSTNAME_CMP01 }}
             role: salt_minion
@@ -475,8 +488,8 @@
                   cloudinit_meta_data: *cloudinit_meta_data
                   cloudinit_user_data: *cloudinit_user_data_1604
 
-              interfaces: *interfaces
-              network_config: *network_config
+              interfaces: *all_interfaces
+              network_config: *all_network_config
 
           - name: {{ HOSTNAME_CMP02 }}
             role: salt_minion
@@ -501,8 +514,8 @@
                   cloudinit_meta_data: *cloudinit_meta_data
                   cloudinit_user_data: *cloudinit_user_data_1604
 
-              interfaces: *interfaces
-              network_config: *network_config
+              interfaces: *all_interfaces
+              network_config: *all_network_config
 
           - name: {{ HOSTNAME_CMP03 }}
             role: salt_minion
@@ -527,8 +540,8 @@
                   cloudinit_meta_data: *cloudinit_meta_data
                   cloudinit_user_data: *cloudinit_user_data_1604
 
-              interfaces: *interfaces
-              network_config: *network_config
+              interfaces: *all_interfaces
+              network_config: *all_network_config
 
           - name: {{ HOSTNAME_CMP04 }}
             role: salt_minion
@@ -553,8 +566,8 @@
                   cloudinit_meta_data: *cloudinit_meta_data
                   cloudinit_user_data: *cloudinit_user_data_1604
 
-              interfaces: *interfaces
-              network_config: *network_config
+              interfaces: *all_interfaces
+              network_config: *all_network_config
 
           - name: {{ HOSTNAME_PRX01 }}
             role: salt_minion
@@ -579,8 +592,8 @@
                   cloudinit_meta_data: *cloudinit_meta_data
                   cloudinit_user_data: *cloudinit_user_data_1604_swp
 
-              interfaces: *interfaces
-              network_config: *network_config
+              interfaces: *all_interfaces
+              network_config: *all_network_config
 
           - name: {{ HOSTNAME_PRX02 }}
             role: salt_minion
@@ -605,5 +618,5 @@
                   cloudinit_meta_data: *cloudinit_meta_data
                   cloudinit_user_data: *cloudinit_user_data_1604_swp
 
-              interfaces: *interfaces
-              network_config: *network_config
+              interfaces: *all_interfaces
+              network_config: *all_network_config