Merge "Add k8s metallb switch parameter in k8s models"
diff --git a/classes/cluster/k8s-aio-calico/kubernetes/control.yml b/classes/cluster/k8s-aio-calico/kubernetes/control.yml
index 98bc75b..e337107 100644
--- a/classes/cluster/k8s-aio-calico/kubernetes/control.yml
+++ b/classes/cluster/k8s-aio-calico/kubernetes/control.yml
@@ -46,6 +46,10 @@
           agent_image: ${_param:kubernetes_netchecker_agent_image}
           server_image: ${_param:kubernetes_netchecker_server_image}
           agent_probeurls: ${_param:kubernetes_netchecker_agent_probeurls}
+        metallb:
+          enabled: ${_param:kubernetes_metallb_enabled}
+          addresses:
+          - ${_param:kubernetes_metallb_addresses_pool}
     master:
       etcd:
         ssl:
diff --git a/classes/cluster/k8s-aio-calico/kubernetes/init.yml b/classes/cluster/k8s-aio-calico/kubernetes/init.yml
index e15ff5b..be6201c 100644
--- a/classes/cluster/k8s-aio-calico/kubernetes/init.yml
+++ b/classes/cluster/k8s-aio-calico/kubernetes/init.yml
@@ -65,10 +65,12 @@
     kubernetes_externaldns_image: mirantis/external-dns:latest
     kubernetes_externaldns_provider: coredns
 
+    kubernetes_metallb_addresses_pool: 172.16.10.60-172.16.10.80
+
     # switches of addons
     kubernetes_coredns_enabled: false
     kubernetes_externaldns_enabled: false
-
+    kubernetes_metallb_enabled: false
   linux:
     network:
       host:
diff --git a/classes/cluster/k8s-compact/kubernetes/control.yml b/classes/cluster/k8s-compact/kubernetes/control.yml
index 53dcbf8..d937d71 100644
--- a/classes/cluster/k8s-compact/kubernetes/control.yml
+++ b/classes/cluster/k8s-compact/kubernetes/control.yml
@@ -47,6 +47,10 @@
           enabled: ${_param:kubernetes_externaldns_enabled}
           image: ${_param:kubernetes_externaldns_image}
           provider: ${_param:kubernetes_externaldns_provider}
+        metallb:
+          enabled: ${_param:kubernetes_metallb_enabled}
+          addresses:
+          - ${_param:kubernetes_metallb_addresses_pool}
     master:
       service_addresses: 10.201.0.0/16
       addons:
diff --git a/classes/cluster/k8s-compact/kubernetes/init.yml b/classes/cluster/k8s-compact/kubernetes/init.yml
index 7a71f6a..fd00525 100644
--- a/classes/cluster/k8s-compact/kubernetes/init.yml
+++ b/classes/cluster/k8s-compact/kubernetes/init.yml
@@ -49,3 +49,5 @@
     kubernetes_virtlet_enabled: true
     kubernetes_coredns_enabled: false
     kubernetes_externaldns_enabled: false
+    kubernetes_metallb_addresses_pool: 172.16.10.60-172.16.10.80
+    kubernetes_metallb_enabled: false
\ No newline at end of file
diff --git a/classes/cluster/k8s-ha-calico-cloudprovider/kubernetes/control.yml b/classes/cluster/k8s-ha-calico-cloudprovider/kubernetes/control.yml
index 958cdd8..4f599fb 100644
--- a/classes/cluster/k8s-ha-calico-cloudprovider/kubernetes/control.yml
+++ b/classes/cluster/k8s-ha-calico-cloudprovider/kubernetes/control.yml
@@ -38,6 +38,10 @@
           enabled: ${_param:kubernetes_externaldns_enabled}
           image: ${_param:kubernetes_externaldns_image}
           provider: ${_param:kubernetes_externaldns_provider}
+        metallb:
+          enabled: ${_param:kubernetes_metallb_enabled}
+          addresses:
+          - ${_param:kubernetes_metallb_addresses_pool}
       cloudprovider:
         enabled: true
         provider: openstack
diff --git a/classes/cluster/k8s-ha-calico-cloudprovider/kubernetes/init.yml b/classes/cluster/k8s-ha-calico-cloudprovider/kubernetes/init.yml
index b4aa8f8..507ee20 100644
--- a/classes/cluster/k8s-ha-calico-cloudprovider/kubernetes/init.yml
+++ b/classes/cluster/k8s-ha-calico-cloudprovider/kubernetes/init.yml
@@ -49,9 +49,12 @@
     kubernetes_externaldns_image: mirantis/external-dns:latest
     kubernetes_externaldns_provider: coredns
 
+    kubernetes_metallb_addresses_pool: 172.16.10.60-172.16.10.80
+
     # switches of addons
     kubernetes_coredns_enabled: false
     kubernetes_externaldns_enabled: false
+    kubernetes_metallb_enabled: false
 
     # OpenStack cloud provider
     openstack_auth_url: https://cloud-cz.bud.mirantis.net:5000/v3
diff --git a/classes/cluster/k8s-ha-calico-flannel-virtlet/kubernetes/control.yml b/classes/cluster/k8s-ha-calico-flannel-virtlet/kubernetes/control.yml
index d6e794e..e9ded9a 100644
--- a/classes/cluster/k8s-ha-calico-flannel-virtlet/kubernetes/control.yml
+++ b/classes/cluster/k8s-ha-calico-flannel-virtlet/kubernetes/control.yml
@@ -56,6 +56,10 @@
           enabled: ${_param:kubernetes_externaldns_enabled}
           image: ${_param:kubernetes_externaldns_image}
           provider: ${_param:kubernetes_externaldns_provider}
+        metallb:
+          enabled: ${_param:kubernetes_metallb_enabled}
+          addresses:
+          - ${_param:kubernetes_metallb_addresses_pool}
     master:
       kubelet:
         address: ${_param:single_address}
diff --git a/classes/cluster/k8s-ha-calico-flannel-virtlet/kubernetes/init.yml b/classes/cluster/k8s-ha-calico-flannel-virtlet/kubernetes/init.yml
index eaf709b..02e61af 100644
--- a/classes/cluster/k8s-ha-calico-flannel-virtlet/kubernetes/init.yml
+++ b/classes/cluster/k8s-ha-calico-flannel-virtlet/kubernetes/init.yml
@@ -87,9 +87,12 @@
     kubernetes_externaldns_image: mirantis/external-dns:latest
     kubernetes_externaldns_provider: coredns
 
+    kubernetes_metallb_addresses_pool: 172.16.10.60-172.16.10.80
+
     # switches of addons
     kubernetes_coredns_enabled: false
     kubernetes_externaldns_enabled: false
+    kubernetes_metallb_enabled: false
 
   linux:
     network:
diff --git a/classes/cluster/k8s-ha-calico-syndic/kubernetes/control.yml b/classes/cluster/k8s-ha-calico-syndic/kubernetes/control.yml
index bd70fbe..e5d57b3 100644
--- a/classes/cluster/k8s-ha-calico-syndic/kubernetes/control.yml
+++ b/classes/cluster/k8s-ha-calico-syndic/kubernetes/control.yml
@@ -56,6 +56,10 @@
           enabled: ${_param:kubernetes_externaldns_enabled}
           image: ${_param:kubernetes_externaldns_image}
           provider: ${_param:kubernetes_externaldns_provider}
+        metallb:
+          enabled: ${_param:kubernetes_metallb_enabled}
+          addresses:
+          - ${_param:kubernetes_metallb_addresses_pool}
     master:
       kubelet:
         address: ${_param:single_address}
diff --git a/classes/cluster/k8s-ha-calico-syndic/kubernetes/init.yml b/classes/cluster/k8s-ha-calico-syndic/kubernetes/init.yml
index 896c3b2..2cccdfa 100644
--- a/classes/cluster/k8s-ha-calico-syndic/kubernetes/init.yml
+++ b/classes/cluster/k8s-ha-calico-syndic/kubernetes/init.yml
@@ -86,9 +86,12 @@
     kubernetes_externaldns_image: mirantis/external-dns:latest
     kubernetes_externaldns_provider: coredns
 
+    kubernetes_metallb_addresses_pool: 172.16.10.60-172.16.10.80
+
     # switches of addons
     kubernetes_coredns_enabled: false
     kubernetes_externaldns_enabled: false
+    kubernetes_metallb_enabled: false
 
   linux:
     network:
diff --git a/classes/cluster/k8s-ha-calico/kubernetes/control.yml b/classes/cluster/k8s-ha-calico/kubernetes/control.yml
index 9c854ff..4dd4bc3 100644
--- a/classes/cluster/k8s-ha-calico/kubernetes/control.yml
+++ b/classes/cluster/k8s-ha-calico/kubernetes/control.yml
@@ -56,6 +56,10 @@
           enabled: ${_param:kubernetes_externaldns_enabled}
           image: ${_param:kubernetes_externaldns_image}
           provider: ${_param:kubernetes_externaldns_provider}
+        metallb:
+          enabled: ${_param:kubernetes_metallb_enabled}
+          addresses:
+          - ${_param:kubernetes_metallb_addresses_pool}
     master:
       kubelet:
         address: ${_param:single_address}
diff --git a/classes/cluster/k8s-ha-calico/kubernetes/init.yml b/classes/cluster/k8s-ha-calico/kubernetes/init.yml
index 232bfe1..fbbcb8d 100644
--- a/classes/cluster/k8s-ha-calico/kubernetes/init.yml
+++ b/classes/cluster/k8s-ha-calico/kubernetes/init.yml
@@ -86,9 +86,12 @@
     kubernetes_externaldns_image: mirantis/external-dns:latest
     kubernetes_externaldns_provider: coredns
 
+    kubernetes_metallb_addresses_pool: 172.16.10.60-172.16.10.80
+
     # switches of addons
     kubernetes_coredns_enabled: false
     kubernetes_externaldns_enabled: false
+    kubernetes_metallb_enabled: false
 
   linux:
     network:
diff --git a/classes/cluster/sl-k8s-calico/kubernetes/control.yml b/classes/cluster/sl-k8s-calico/kubernetes/control.yml
index b3e2038..528c86e 100644
--- a/classes/cluster/sl-k8s-calico/kubernetes/control.yml
+++ b/classes/cluster/sl-k8s-calico/kubernetes/control.yml
@@ -44,6 +44,10 @@
           enabled: ${_param:kubernetes_externaldns_enabled}
           image: ${_param:kubernetes_externaldns_image}
           provider: ${_param:kubernetes_externaldns_provider}
+        metallb:
+          enabled: ${_param:kubernetes_metallb_enabled}
+          addresses:
+          - ${_param:kubernetes_metallb_addresses_pool}
     master:
       kubelet:
         fail_on_swap: ${_param:kubelet_fail_on_swap}
diff --git a/classes/cluster/sl-k8s-calico/kubernetes/init.yml b/classes/cluster/sl-k8s-calico/kubernetes/init.yml
index c97e665..6976009 100644
--- a/classes/cluster/sl-k8s-calico/kubernetes/init.yml
+++ b/classes/cluster/sl-k8s-calico/kubernetes/init.yml
@@ -37,6 +37,7 @@
     kubernetes_criproxy_checksum: md5=115bbb0c27518db6b0b3bc8cdc5fc897
     kubernetes_externaldns_image: mirantis/external-dns:latest
     kubernetes_externaldns_provider: coredns
+    kubernetes_metallb_addresses_pool: 172.16.10.60-172.16.10.80
 
     # switches of addons
     kubernetes_helm_enabled: true
@@ -45,6 +46,7 @@
     kubernetes_virtlet_enabled: false
     kubernetes_coredns_enabled: false
     kubernetes_externaldns_enabled: false
+    kubernetes_metallb_enabled: false
 
     # addresses and hostnames
     kubernetes_internal_api_address: 10.254.0.1
diff --git a/classes/cluster/virtual-mcp11-k8s-calico-dyn/kubernetes/control.yml b/classes/cluster/virtual-mcp11-k8s-calico-dyn/kubernetes/control.yml
index 08bac4e..2d63a87 100644
--- a/classes/cluster/virtual-mcp11-k8s-calico-dyn/kubernetes/control.yml
+++ b/classes/cluster/virtual-mcp11-k8s-calico-dyn/kubernetes/control.yml
@@ -45,6 +45,10 @@
           enabled: ${_param:kubernetes_externaldns_enabled}
           image: ${_param:kubernetes_externaldns_image}
           provider: ${_param:kubernetes_externaldns_provider}
+        metallb:
+          enabled: ${_param:kubernetes_metallb_enabled}
+          addresses:
+          - ${_param:kubernetes_metallb_addresses_pool}
     master:
       etcd:
         ssl:
diff --git a/classes/cluster/virtual-mcp11-k8s-calico-dyn/kubernetes/init.yml b/classes/cluster/virtual-mcp11-k8s-calico-dyn/kubernetes/init.yml
index 7f37f36..0d6c642 100644
--- a/classes/cluster/virtual-mcp11-k8s-calico-dyn/kubernetes/init.yml
+++ b/classes/cluster/virtual-mcp11-k8s-calico-dyn/kubernetes/init.yml
@@ -30,6 +30,7 @@
     kubernetes_netchecker_agent_probeurls: "http://ipinfo.io"
     kubernetes_externaldns_image: mirantis/external-dns:latest
     kubernetes_externaldns_provider: coredns
+    kubernetes_metallb_addresses_pool: 172.16.10.60-172.16.10.80
 
     # switches of addons
     kubernetes_helm_enabled: true
@@ -37,6 +38,7 @@
     kubernetes_calico_policy_enabled: false
     kubernetes_coredns_enabled: false
     kubernetes_externaldns_enabled: false
+    kubernetes_metallb_enabled: false
 
     # addresses and hostnames
     kubernetes_internal_api_address: 10.254.0.1
diff --git a/classes/cluster/virtual-mcp11-k8s-calico-minimal/kubernetes/control.yml b/classes/cluster/virtual-mcp11-k8s-calico-minimal/kubernetes/control.yml
index 077036e..684d5af 100644
--- a/classes/cluster/virtual-mcp11-k8s-calico-minimal/kubernetes/control.yml
+++ b/classes/cluster/virtual-mcp11-k8s-calico-minimal/kubernetes/control.yml
@@ -45,6 +45,10 @@
           enabled: ${_param:kubernetes_externaldns_enabled}
           image: ${_param:kubernetes_externaldns_image}
           provider: ${_param:kubernetes_externaldns_provider}
+        metallb:
+          enabled: ${_param:kubernetes_metallb_enabled}
+          addresses:
+          - ${_param:kubernetes_metallb_addresses_pool}
     master:
       etcd:
         ssl:
diff --git a/classes/cluster/virtual-mcp11-k8s-calico-minimal/kubernetes/init.yml b/classes/cluster/virtual-mcp11-k8s-calico-minimal/kubernetes/init.yml
index 152e946..f213ed6 100644
--- a/classes/cluster/virtual-mcp11-k8s-calico-minimal/kubernetes/init.yml
+++ b/classes/cluster/virtual-mcp11-k8s-calico-minimal/kubernetes/init.yml
@@ -62,12 +62,15 @@
     calico_private_network: 192.168.0.0
     calico_private_netmask: 16
 
+    kubernetes_metallb_addresses_pool: 172.16.10.60-172.16.10.80
+
     # k8s addons
     kubernetes_calico_policy_enabled: false
     kubernetes_helm_enabled: true
     kubernetes_netchecker_enabled: true
     kubernetes_coredns_enabled: false
     kubernetes_externaldns_enabled: false
+    kubernetes_metallb_enabled: false
 
   linux:
     network:
diff --git a/classes/cluster/virtual-mcp11-k8s-calico/kubernetes/control.yml b/classes/cluster/virtual-mcp11-k8s-calico/kubernetes/control.yml
index ddfae1e..501769f 100644
--- a/classes/cluster/virtual-mcp11-k8s-calico/kubernetes/control.yml
+++ b/classes/cluster/virtual-mcp11-k8s-calico/kubernetes/control.yml
@@ -59,6 +59,10 @@
           enabled: ${_param:kubernetes_externaldns_enabled}
           image: ${_param:kubernetes_externaldns_image}
           provider: ${_param:kubernetes_externaldns_provider}
+        metallb:
+          enabled: ${_param:kubernetes_metallb_enabled}
+          addresses:
+          - ${_param:kubernetes_metallb_addresses_pool}
     master:
       kubelet:
         address: ${_param:single_address}
diff --git a/classes/cluster/virtual-mcp11-k8s-calico/kubernetes/init.yml b/classes/cluster/virtual-mcp11-k8s-calico/kubernetes/init.yml
index f6f9f92..eb22748 100644
--- a/classes/cluster/virtual-mcp11-k8s-calico/kubernetes/init.yml
+++ b/classes/cluster/virtual-mcp11-k8s-calico/kubernetes/init.yml
@@ -92,9 +92,12 @@
     kubernetes_externaldns_image: mirantis/external-dns:latest
     kubernetes_externaldns_provider: coredns
 
+    kubernetes_metallb_addresses_pool: 172.16.10.60-172.16.10.80
+
     # switches of addons
     kubernetes_coredns_enabled: false
     kubernetes_externaldns_enabled: false
+    kubernetes_metallb_enabled: false
 
   linux:
     network: