Refactor parameters for k8s-ha-calico model.

* Moved k8s parameters to init file.
* Moved virtlet addon to compute k8s nodes.
* Moved k8s router from ens4 to ens3

Change-Id: I325dcabad7a4b9c062ca2765d9d9643052ca0327
diff --git a/classes/cluster/k8s-ha-calico/infra/config.yml b/classes/cluster/k8s-ha-calico/infra/config.yml
index 04e2380..d452b0a 100644
--- a/classes/cluster/k8s-ha-calico/infra/config.yml
+++ b/classes/cluster/k8s-ha-calico/infra/config.yml
@@ -15,6 +15,7 @@
     reclass_data_revision: master
     reclass_config_master: ${_param:infra_config_deploy_address}
     single_address: ${_param:infra_config_address}
+    deploy_address: ${_param:infra_config_deploy_address}
     linux_system_codename: xenial
     salt_api_password_hash: "$6$WV0P1shnoDh2gI/Z$22/Bcd7ffMv0jDlFpT63cAU4PiXHz9pjXwngToKwqAsgoeK4HNR3PiKaushjxp3JsQ8hNoJmAC6TxzVqfV8WH/"
     salt_master_host: 127.0.0.1
@@ -25,16 +26,6 @@
       reactor:
         reclass/minion/classify:
         - salt://reclass/reactor/node_register.sls
-      environment:
-      # TODO: remove formulas in development once they are stable and part of shared the system-level reclass
-        prd:
-          formula:
-            helm:
-              source: pkg
-              name: salt-formula-helm
-              #source: git
-              #address: '${_param:salt_master_environment_repository}/salt-formula-helm.git'
-              #revision: ${_param:salt_master_environment_revision}
   reclass:
     storage:
       class_mapping:
@@ -47,6 +38,8 @@
               value_template: <<node_os>>
             salt_master_host:
               value_template: <<node_master_ip>>
+            deploy_address:
+              value_template: <<node_deploy_ip>>
         infra_config:
           expression: <<node_hostname>>__startswith__cfg
           cluster_param:
@@ -61,18 +54,27 @@
           cluster_param:
             kubernetes_control_node01_address:
               value_template: <<node_control_ip>>
+            kubernetes_control_node01_deploy_address:
+              value_template: <<node_deploy_ip>>
         kubernetes_control02:
           expression: <<node_hostname>>__equals__ctl02
           cluster_param:
             kubernetes_control_node02_address:
               value_template: <<node_control_ip>>
+            kubernetes_control_node02_deploy_address:
+              value_template: <<node_deploy_ip>>
         kubernetes_control03:
           expression: <<node_hostname>>__equals__ctl03
           cluster_param:
             kubernetes_control_node03_address:
               value_template: <<node_control_ip>>
+            kubernetes_control_node03_deploy_address:
+              value_template: <<node_deploy_ip>>
         kubernetes_compute:
           expression: <<node_hostname>>__startswith__cmp
           node_class:
             value_template:
               - cluster.<<node_cluster>>.kubernetes.compute
+          node_param:
+            deploy_address:
+              value_template: <<node_deploy_ip>>
diff --git a/classes/cluster/k8s-ha-calico/infra/init.yml b/classes/cluster/k8s-ha-calico/infra/init.yml
index 253e3f6..1ead07a 100644
--- a/classes/cluster/k8s-ha-calico/infra/init.yml
+++ b/classes/cluster/k8s-ha-calico/infra/init.yml
@@ -23,15 +23,6 @@
           names:
           - ${_param:infra_config_hostname}
           - ${_param:infra_config_hostname}.${_param:cluster_domain}
-      interface:
-        primary_interface:
-          enabled: true
-          type: eth
-          proto: dhcp
-          #proto: static
-          #name: ${_param:primary_interface}
-          #address: ${_param:single_address}
-          #netmask: 255.255.255.0
     system:
       name: ${_param:infra_config_hostname}
       domain: ${_param:cluster_domain}
diff --git a/classes/cluster/k8s-ha-calico/kubernetes/compute.yml b/classes/cluster/k8s-ha-calico/kubernetes/compute.yml
index 98b7a47..be8ae98 100644
--- a/classes/cluster/k8s-ha-calico/kubernetes/compute.yml
+++ b/classes/cluster/k8s-ha-calico/kubernetes/compute.yml
@@ -6,20 +6,17 @@
 - system.salt.minion.cert.etcd_client
 - cluster.k8s-ha-calico
 parameters:
-  _param:
-    kubernetes_calicoctl_image: docker-prod-virtual.docker.mirantis.net/mirantis/projectcalico/calico/ctl:latest
-    kubernetes_calico_image: docker-prod-virtual.docker.mirantis.net/mirantis/projectcalico/calico/node:latest
-    kubernetes_calico_cni_image: docker-prod-virtual.docker.mirantis.net/mirantis/projectcalico/calico/cni:latest
-    kubernetes_hyperkube_image: docker-prod-virtual.docker.mirantis.net/mirantis/kubernetes/hyperkube-amd64:v1.7.5-2
   docker:
     host:
       pkgs:
-        - docker-engine=1.12.6-0~ubuntu-xenial
+        - ${_param:kubernetes_docker_package}
         - python-docker
       options:
         bip: 172.31.255.1/24
   kubernetes:
     pool:
+      kubelet:
+        address: ${_param:single_address}
       network:
         etcd:
           ssl:
@@ -30,6 +27,13 @@
         cni:
           image: ${_param:kubernetes_calico_cni_image}
     common:
+      addons:
+        virtlet:
+          enabled: ${_param:kubernetes_virtlet_enabled}
+          namespace: ${_param:kubernetes_addon_namespace}
+          image: ${_param:kubernetes_virtlet_image}
+          hosts:
+          - ${linux:system:name}
       hyperkube:
         image: ${_param:kubernetes_hyperkube_image}
   linux:
@@ -40,9 +44,16 @@
           - 172.18.176.4
           - 172.18.176.7
       interface:
-        primary_interface:
+        ens3:
+          enabled: true
+          type: eth
+          proto: static
+          name: ${_param:primary_interface}
+          address: ${_param:deploy_address}
+          netmask: 255.255.255.0
+          gateway: 192.168.10.1
           route:
             kubernetes_services:
               address: 10.254.0.0
               netmask: 255.255.0.0
-              gateway: ${_param:single_address}
+              gateway: ${_param:deploy_address}
\ No newline at end of file
diff --git a/classes/cluster/k8s-ha-calico/kubernetes/control.yml b/classes/cluster/k8s-ha-calico/kubernetes/control.yml
index e45aea5..855b338 100644
--- a/classes/cluster/k8s-ha-calico/kubernetes/control.yml
+++ b/classes/cluster/k8s-ha-calico/kubernetes/control.yml
@@ -26,6 +26,8 @@
       #      logLevel: INFO
   etcd:
     server:
+      bind:
+        host: ${_param:deploy_address}
       source:
         engine: docker_hybrid
       ssl:
@@ -37,11 +39,21 @@
   kubernetes:
     common:
       addons:
-        netchecker:
-          enabled: true
+        dashboard:
+          enabled: ${_param:kubernetes_dashboard}
         helm:
-          enabled: false
+          enabled: ${_param:kubernetes_helm_enabled}
+        calico_policy:
+          enabled: ${_param:kubernetes_calico_policy_enabled}
+          image: ${_param:kubernetes_calico_policy_image}
+        netchecker:
+          enabled: ${_param:kubernetes_netchecker_enabled}
+          agent_image: ${_param:kubernetes_netchecker_agent_image}
+          server_image: ${_param:kubernetes_netchecker_server_image}
+          agent_probeurls: ${_param:kubernetes_netchecker_agent_probeurls}
     master:
+      kubelet:
+        address: ${_param:single_address}
       etcd:
         ssl:
           enabled: true
diff --git a/classes/cluster/k8s-ha-calico/kubernetes/init.yml b/classes/cluster/k8s-ha-calico/kubernetes/init.yml
index 1c4dfda..d1270cd 100644
--- a/classes/cluster/k8s-ha-calico/kubernetes/init.yml
+++ b/classes/cluster/k8s-ha-calico/kubernetes/init.yml
@@ -14,6 +14,29 @@
     kubernetes_dns_token: 0S1I4iJeFjq5fopPwwCwTp3xFpEZfeUl
     etcd_initial_token: IN7KaRMSo3xkGxkjAAPtkRkAgqN4ZNRq
 
+    # docker package version
+    kubernetes_docker_package: docker-engine=1.12.6-0~ubuntu-xenial
+
+    # component docker images
+    kubernetes_calicoctl_image: docker-prod-virtual.docker.mirantis.net/mirantis/projectcalico/calico/ctl:latest
+    kubernetes_calico_image: docker-prod-virtual.docker.mirantis.net/mirantis/projectcalico/calico/node:latest
+    kubernetes_calico_cni_image: docker-prod-virtual.docker.mirantis.net/mirantis/projectcalico/calico/cni:latest
+    kubernetes_calico_policy_image: calico/kube-policy-controller:v0.5.4
+
+    kubernetes_hyperkube_image: docker-prod-virtual.docker.mirantis.net/mirantis/kubernetes/hyperkube-amd64:v1.7.5-2
+    kubernetes_virtlet_image: mirantis/virtlet:latest
+    kubernetes_netchecker_agent_image: mirantis/k8s-netchecker-agent:stable
+    kubernetes_netchecker_server_image: mirantis/k8s-netchecker-server:stable
+    kubernetes_netchecker_agent_probeurls: "http://ipinfo.io"
+
+    # switches of addons
+    kubernetes_addon_namespace: kube-system
+    kubernetes_dashboard: false
+    kubernetes_helm_enabled: false
+    kubernetes_netchecker_enabled: true
+    kubernetes_calico_policy_enabled: false
+    kubernetes_virtlet_enabled: false
+
     # addresses and hostnames
     kubernetes_internal_api_address: 10.254.0.1
     kubernetes_control_hostname: ctl
@@ -24,21 +47,22 @@
     kubernetes_control_node01_address: 172.16.10.101
     kubernetes_control_node02_address: 172.16.10.102
     kubernetes_control_node03_address: 172.16.10.103
-    kubernetes_proxy_node01_hostname: prx01
-    kubernetes_proxy_node01_address: 172.16.10.121
+    kubernetes_control_node01_deploy_address: 192.168.10.101
+    kubernetes_control_node02_deploy_address: 192.168.10.102
+    kubernetes_control_node03_deploy_address: 192.168.10.103
 
     cluster_vip_address: ${_param:kubernetes_control_address}
-    cluster_local_address: ${_param:single_address}
+    cluster_local_address: ${_param:deploy_address}
 
     # etcd stuff
     cluster_node01_hostname: ${_param:kubernetes_control_node01_hostname}
-    cluster_node01_address: ${_param:kubernetes_control_node01_address}
+    cluster_node01_address: ${_param:kubernetes_control_node01_deploy_address}
     cluster_node01_port: 4001
     cluster_node02_hostname: ${_param:kubernetes_control_node02_hostname}
-    cluster_node02_address: ${_param:kubernetes_control_node02_address}
+    cluster_node02_address: ${_param:kubernetes_control_node02_deploy_address}
     cluster_node02_port: 4001
     cluster_node03_hostname: ${_param:kubernetes_control_node03_hostname}
-    cluster_node03_address: ${_param:kubernetes_control_node03_address}
+    cluster_node03_address: ${_param:kubernetes_control_node03_deploy_address}
     cluster_node03_port: 4001
 
     # calico
@@ -68,31 +92,3 @@
           names:
           - ${_param:kubernetes_control_node03_hostname}
           - ${_param:kubernetes_control_node03_hostname}.${_param:cluster_domain}
-        prx01:
-          address: ${_param:kubernetes_proxy_node01_address}
-          names:
-          - ${_param:kubernetes_proxy_node01_hostname}
-          - ${_param:kubernetes_proxy_node01_hostname}.${_param:cluster_domain}
-    linux:
-      network:
-        interface:
-          primary_interface:
-            route:
-              # TODO: Remove comment.
-              # Will work once CI has this in linux formula (packaged): https://gerrit.mcp.mirantis.net/#/c/8952
-              kubernetes_internal:
-                address: 10.254.0.0
-                netmask: 255.255.0.0
-    system:
-      rc:
-        local: |
-          #!/bin/sh -e
-          #
-          # rc.local
-          #
-          ######### This file is managed by Salt! ##########
-          # This script is executed at the end of each multiuser runlevel.
-          # Make sure that the script will "exit 0" on success or any other
-          # value on error.
-          #
-          exit 0