add virtual_mcp_k8s-contrail model

Change-Id: I05ddbdd8ba147acb683b3928682e8ed42642d4ae
diff --git a/classes/cluster/virtual-mcp11-k8s-contrail/infra/config.yml b/classes/cluster/virtual-mcp11-k8s-contrail/infra/config.yml
new file mode 100644
index 0000000..4de736d
--- /dev/null
+++ b/classes/cluster/virtual-mcp11-k8s-contrail/infra/config.yml
@@ -0,0 +1,72 @@
+classes:
+- system.linux.system.repo.mcp.salt
+- system.linux.system.repo.ubuntu
+- system.openssh.client.lab
+- system.salt.master.pkg
+- system.salt.minion.ca.salt_master
+- system.salt.master.api
+- system.reclass.storage.salt
+- system.salt.minion.cert.k8s_server
+- system.reclass.storage.system.kubernetes_control_cluster
+- system.reclass.storage.system.opencontrail_control_cluster
+- cluster.virtual-mcp11-k8s-contrail.infra
+parameters:
+  _param:
+    salt_master_base_environment: prd
+    reclass_data_repository: "https://gerrit.mcp.mirantis.net/salt-models/mcp-virtual-lab"
+    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: ${_param:infra_config_address}
+    apt_mk_version: nightly
+  reclass:
+    storage:
+      node:
+        kubernetes_compute_node01:
+          name: ${_param:kubernetes_compute_node01_hostname}
+          domain: ${_param:cluster_domain}
+          classes:
+          - cluster.${_param:cluster_name}.kubernetes.compute
+          params:
+            salt_master_host: ${_param:infra_config_address}
+            linux_system_codename: xenial
+            single_address: ${_param:kubernetes_compute_node01_address}
+        kubernetes_compute_node02:
+          name: ${_param:kubernetes_compute_node02_hostname}
+          domain: ${_param:cluster_domain}
+          classes:
+          - cluster.${_param:cluster_name}.kubernetes.compute
+          params:
+            salt_master_host: ${_param:infra_config_address}
+            linux_system_codename: xenial
+            single_address: ${_param:kubernetes_compute_node02_address}
+        prx_node:
+          name: ${_param:kubernetes_proxy_node01_hostname}
+          domain: ${_param:cluster_domain}
+          classes:
+          - cluster.${_param:cluster_name}.infra
+          params:
+            salt_master_host: ${_param:infra_config_address}
+            linux_system_codename: xenial
+            single_address: ${_param:kubernetes_proxy_node01_address}
+        mon_node:
+          name: ${_param:kubernetes_monitor_node01_hostname}
+          domain: ${_param:cluster_domain}
+          classes:
+          - cluster.${_param:cluster_name}.infra
+          params:
+            salt_master_host: ${_param:infra_config_address}
+            linux_system_codename: xenial
+            single_address: ${_param:kubernetes_monitor_node01_address}
+        opencontrail_control_node01:
+          params:
+            rabbitmq_cluster_role: master
+        opencontrail_control_node02:
+          params:
+            rabbitmq_cluster_role: slave
+        opencontrail_control_node03:
+          params:
+            rabbitmq_cluster_role: slave
diff --git a/classes/cluster/virtual-mcp11-k8s-contrail/infra/init.yml b/classes/cluster/virtual-mcp11-k8s-contrail/infra/init.yml
new file mode 100644
index 0000000..6992cb9
--- /dev/null
+++ b/classes/cluster/virtual-mcp11-k8s-contrail/infra/init.yml
@@ -0,0 +1,43 @@
+
+classes:
+- system.linux.system.single
+- system.openssh.server.team.lab
+- system.openssh.server.team.tcpcloud
+- system.openssh.server.team.mcp_qa
+- cluster.virtual-mcp11-k8s-contrail.kubernetes
+- cluster.virtual-mcp11-k8s-contrail.opencontrail
+parameters:
+  _param:
+
+    # infra service addresses
+    infra_config_hostname: cfg01
+    infra_config_address: 192.168.10.100
+    infra_config_deploy_address: 192.168.10.100
+
+    cluster_domain: virtual-mcp11-k8s-contrail.local
+    cluster_name: virtual-mcp11-k8s-contrail
+    cluster_public_host: 
+
+  linux:
+    network:
+      host:
+        cfg01:
+          address: ${_param:infra_config_address}
+          names:
+          - ${_param:infra_config_hostname}
+          - ${_param:infra_config_hostname}.${_param:cluster_domain}
+        cfg:
+          address: ${_param:infra_config_address}
+          names:
+          - cfg
+          - cfg.${_param:cluster_domain}
+      interface:
+        ens4:
+          enabled: true
+          type: eth
+          proto: static
+          address: ${_param:single_address}
+          netmask: 255.255.255.0
+    system:
+      name: ${_param:infra_config_hostname}
+      domain: ${_param:cluster_domain}
diff --git a/classes/cluster/virtual-mcp11-k8s-contrail/kubernetes/compute.yml b/classes/cluster/virtual-mcp11-k8s-contrail/kubernetes/compute.yml
new file mode 100644
index 0000000..1bb884c
--- /dev/null
+++ b/classes/cluster/virtual-mcp11-k8s-contrail/kubernetes/compute.yml
@@ -0,0 +1,30 @@
+classes:
+- system.linux.system.repo.docker
+- system.kubernetes.pool.cluster
+- system.salt.minion.cert.k8s_client
+- system.salt.minion.cert.etcd_client
+- cluster.virtual-mcp11-k8s-calico.infra
+- cluster.virtual-mcp11-k8s-calico.opencontrail.compute
+parameters:
+  docker:
+    host:
+      pkgs:
+        - docker-engine=1.12.6-0~ubuntu-xenial
+        - python-docker
+  kubernetes:
+    pool:
+      network:
+        engine: opencontrail
+        opencontrail:
+          address: ${_param:opencontrail_control_address}
+        etcd:
+          ssl:
+            enabled: true
+        image: docker-prod-virtual.sandbox.mirantis.net/mirantis/projectcalico/calico/node:latest
+        calicoctl:
+          image: docker-prod-virtual.sandbox.mirantis.net/mirantis/projectcalico/calico/ctl:latest
+        cni:
+          image: docker-prod-virtual.sandbox.mirantis.net/mirantis/projectcalico/calico/cni:latest
+    common:
+      hyperkube:
+        image: docker-prod-virtual.sandbox.mirantis.net/mirantis/kubernetes/hyperkube-amd64:v1.5.4-5
diff --git a/classes/cluster/virtual-mcp11-k8s-contrail/kubernetes/control.yml b/classes/cluster/virtual-mcp11-k8s-contrail/kubernetes/control.yml
new file mode 100644
index 0000000..f7bcd0c
--- /dev/null
+++ b/classes/cluster/virtual-mcp11-k8s-contrail/kubernetes/control.yml
@@ -0,0 +1,46 @@
+classes:
+- service.etcd.server.cluster
+- system.haproxy.proxy.listen.kubernetes.apiserver
+- system.linux.system.repo.docker
+- system.salt.minion.cert.etcd_server
+- system.kubernetes.master.cluster
+- cluster.virtual-mcp11-k8s-calico.kubernetes.compute
+- cluster.virtual-mcp11-k8s-calico.infra
+parameters:
+  _param:
+    keepalived_vip_interface: ens4
+    keepalived_vip_virtual_router_id: 60
+  etcd:
+    server:
+      source:
+        engine: docker_hybrid
+      ssl:
+        enabled: true
+      setup:
+        calico:
+          key: /calico/v1/ipam/v4/pool/${_param:calico_private_network}-${_param:calico_private_netmask}
+          value: '{"masquerade":true,"cidr":"${_param:calico_private_network}/${_param:calico_private_netmask}"}'
+  kubernetes:
+    master:
+      etcd:
+        ssl:
+          enabled: true
+      network:
+        etcd:
+          ssl:
+            enabled: true
+      namespace:
+        netchecker:
+          enabled: true
+      addons:
+        netchecker:
+          enabled: true
+        helm:
+          enabled: true
+      network:
+        engine: opencontrail
+        public_ip_range: 185.22.97.128/26
+        public_network: default-domain:default-project:Public
+        private_ip_range: 10.150.0.0/16
+        opencontrail:
+          address: ${_param:opencontrail_control_address}
diff --git a/classes/cluster/virtual-mcp11-k8s-contrail/kubernetes/init.yml b/classes/cluster/virtual-mcp11-k8s-contrail/kubernetes/init.yml
new file mode 100644
index 0000000..2bd905f
--- /dev/null
+++ b/classes/cluster/virtual-mcp11-k8s-contrail/kubernetes/init.yml
@@ -0,0 +1,88 @@
+
+parameters:
+  _param:
+    salt_minion_ca_host: ${_param:infra_config_hostname}.${_param:cluster_domain}
+    salt_minion_ca_authority: salt_master_ca
+
+    # kubernetes settings
+    kubernetes_admin_user: admin
+    kubernetes_admin_password: sbPfel23ZigJF3Bm
+    kubernetes_admin_token: PpP6Mm3pAoPVqcKOKUu0x1dh7b1959Fi
+    kubernetes_kubelet_token: JJ2PKHxjiU6EYvIt18BqwdSK1HvWh8pt
+    kubernetes_kube-proxy_token: jT0hJk9L6cIw5UpYDNhsRwcj3Z2n62B6
+    kubernetes_scheduler_token: VgkUHfrW07zNxrb0ucFyX7NBnSJN9Xp6
+    kubernetes_controller-manager_token: uXrdZ1YKF6qlYm3sHje2iEXMGAGDWOIU
+    kubernetes_dns_token: 0S1I4iJeFjq5fopPwwCwTp3xFpEZfeUl
+    etcd_initial_token: IN7KaRMSo3xkGxkjAAPtkRkAgqN4ZNRq
+
+    # addresses and hostnames
+    kubernetes_internal_api_address: 10.254.0.1
+    kubernetes_control_hostname: ctl
+    kubernetes_control_address: 172.16.10.253
+    kubernetes_control_node01_hostname: ctl01
+    kubernetes_control_node02_hostname: ctl02
+    kubernetes_control_node03_hostname: ctl03
+    kubernetes_compute_node01_hostname: cmp01
+    kubernetes_compute_node02_hostname: cmp02
+    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_compute_node01_address: 172.16.10.105
+    kubernetes_compute_node02_address: 172.16.10.106
+    kubernetes_proxy_node01_hostname: prx01
+    kubernetes_proxy_node01_address: 172.16.10.121
+    kubernetes_monitor_node01_hostname: mon01
+    kubernetes_monitor_node01_address: 172.16.10.107
+
+
+    cluster_vip_address: ${_param:kubernetes_control_address}
+    cluster_local_address: ${_param:single_address}
+
+    # etcd stuff
+    cluster_node01_hostname: ${_param:kubernetes_control_node01_hostname}
+    cluster_node01_address: ${_param:kubernetes_control_node01_address}
+    cluster_node01_port: 4001
+    cluster_node02_hostname: ${_param:kubernetes_control_node02_hostname}
+    cluster_node02_address: ${_param:kubernetes_control_node02_address}
+    cluster_node02_port: 4001
+    cluster_node03_hostname: ${_param:kubernetes_control_node03_hostname}
+    cluster_node03_address: ${_param:kubernetes_control_node03_address}
+    cluster_node03_port: 4001
+
+    # calico
+    calico_private_network: 192.168.0.0
+    calico_private_netmask: 16
+
+  linux:
+    network:
+      host:
+        ctl:
+          address: ${_param:kubernetes_control_address}
+          names:
+          - ${_param:kubernetes_control_hostname}
+          - ${_param:kubernetes_control_hostname}.${_param:cluster_domain}
+        ctl01:
+          address: ${_param:kubernetes_control_node01_address}
+          names:
+          - ${_param:kubernetes_control_node01_hostname}
+          - ${_param:kubernetes_control_node01_hostname}.${_param:cluster_domain}
+        ctl02:
+          address: ${_param:kubernetes_control_node02_address}
+          names:
+          - ${_param:kubernetes_control_node02_hostname}
+          - ${_param:kubernetes_control_node02_hostname}.${_param:cluster_domain}
+        ctl03:
+          address: ${_param:kubernetes_control_node03_address}
+          names:
+          - ${_param:kubernetes_control_node03_hostname}
+          - ${_param:kubernetes_control_node03_hostname}.${_param:cluster_domain}
+        cmp01:
+          address: ${_param:kubernetes_compute_node01_address}
+          names:
+          - ${_param:kubernetes_compute_node01_hostname}
+          - ${_param:kubernetes_compute_node01_hostname}.${_param:cluster_domain}
+        cmp02:
+          address: ${_param:kubernetes_compute_node02_address}
+          names:
+          - ${_param:kubernetes_compute_node02_hostname}
+          - ${_param:kubernetes_compute_node02_hostname}.${_param:cluster_domain}
diff --git a/classes/cluster/virtual-mcp11-k8s-contrail/opencontrail/compute.yml b/classes/cluster/virtual-mcp11-k8s-contrail/opencontrail/compute.yml
new file mode 100644
index 0000000..e6b7e25
--- /dev/null
+++ b/classes/cluster/virtual-mcp11-k8s-contrail/opencontrail/compute.yml
@@ -0,0 +1,18 @@
+classes:
+- system.opencontrail.compute.cluster
+parameters:
+  _param:
+    opencontrail_compute_address: ${_param:single_address}
+    opencontrail_compute_iface: eth1
+    opencontrail_compute_gateway: 172.16.10.1
+    opencontrail_compute_dns: 8.8.8.8
+  opencontrail:
+    common:
+      identity:
+        engine: k8s
+        host: none
+        token: none
+        password: none
+      network:
+        engine: k8s
+        host: none
diff --git a/classes/cluster/virtual-mcp11-k8s-contrail/opencontrail/control.yml b/classes/cluster/virtual-mcp11-k8s-contrail/opencontrail/control.yml
new file mode 100644
index 0000000..8663b63
--- /dev/null
+++ b/classes/cluster/virtual-mcp11-k8s-contrail/opencontrail/control.yml
@@ -0,0 +1,68 @@
+classes:
+- system.linux.system.lowmem
+- system.linux.system.repo.cassandra
+- system.linux.system.repo.mcp.contrail
+#- system.linux.system.repo.mcp.openstack
+- system.linux.system.repo.mos10
+- system.linux.system.repo.mcp.extra
+- system.linux.system.repo.saltstack.trusty
+#- system.opencontrail.client.resource.edge_router
+- system.rabbitmq.server.cluster
+- system.opencontrail.control.cluster
+- system.opencontrail.client.cluster
+- system.opencontrail.client.resource.control_node
+- system.opencontrail.client.resource.config_node
+- system.opencontrail.client.resource.database_node
+- system.opencontrail.client.resource.analytics_node
+- system.haproxy.proxy.listen.opencontrail.analytics
+- cluster.virtual-mcp11-k8s-contrail.infra
+parameters:
+  _param:
+    keepalived_vip_interface: eth1
+    cluster_vip_address: ${_param:opencontrail_control_address}
+    cluster_local_address: ${_param:single_address}
+    cluster_node01_hostname: ${_param:opencontrail_control_node01_hostname}
+    cluster_node01_address: ${_param:opencontrail_control_node01_address}
+    cluster_node02_hostname: ${_param:opencontrail_control_node02_hostname}
+    cluster_node02_address: ${_param:opencontrail_control_node02_address}
+    cluster_node03_hostname: ${_param:opencontrail_control_node03_hostname}
+    cluster_node03_address: ${_param:opencontrail_control_node03_address}
+    rabbitmq_secret_key: password
+    rabbitmq_admin_password: password
+    # opencontrail_router01_hostname: vsrx01.${_param:cluster_domain}
+    # opencontrail_router01_address: 172.16.10.131
+  linux:
+    network:
+      interface:
+        eth1:
+          enabled: true
+          type: eth
+          proto: dhcp
+  keepalived:
+    cluster:
+      instance:
+        VIP:
+          virtual_router_id: 144
+  opencontrail:
+    common:
+      identity:
+        host: none
+        engine: k8s
+      network:
+        engine: k8s
+    config:
+      network:
+        engine: k8s
+      identity:
+        engine: k8s
+        region: none
+        host: none
+      multi_tenancy: false
+      message_queue:
+        host: ${_param:opencontrail_control_address}
+    web:
+      network:
+        engine: k8s
+      identity:
+        engine: k8s
+        host: none
\ No newline at end of file
diff --git a/classes/cluster/virtual-mcp11-k8s-contrail/opencontrail/init.yml b/classes/cluster/virtual-mcp11-k8s-contrail/opencontrail/init.yml
new file mode 100644
index 0000000..a880fee
--- /dev/null
+++ b/classes/cluster/virtual-mcp11-k8s-contrail/opencontrail/init.yml
@@ -0,0 +1,36 @@
+parameters:
+  _param:
+    opencontrail_version: 3.0
+    opencontrail_control_hostname: ntw
+    opencontrail_control_node01_hostname: ntw01
+    opencontrail_control_node02_hostname: ntw02
+    opencontrail_control_node03_hostname: ntw03
+
+    opencontrail_control_address: 172.16.10.252
+    opencontrail_control_node01_address: 172.16.10.110
+    opencontrail_control_node02_address: 172.16.10.111
+    opencontrail_control_node03_address: 172.16.10.112
+
+  linux:
+    network:
+      host:
+        ntw:
+          address: ${_param:opencontrail_control_address}
+          names:
+          - ${_param:opencontrail_control_hostname}
+          - ${_param:opencontrail_control_hostname}.${_param:cluster_domain}
+        ntw01:
+          address: ${_param:opencontrail_control_node01_address}
+          names:
+          - ${_param:opencontrail_control_node01_hostname}
+          - ${_param:opencontrail_control_node01_hostname}.${_param:cluster_domain}
+        ntw02:
+          address: ${_param:opencontrail_control_node02_address}
+          names:
+          - ${_param:opencontrail_control_node02_hostname}
+          - ${_param:opencontrail_control_node02_hostname}.${_param:cluster_domain}
+        ntw03:
+          address: ${_param:opencontrail_control_node03_address}
+          names:
+          - ${_param:opencontrail_control_node03_hostname}
+          - ${_param:opencontrail_control_node03_hostname}.${_param:cluster_domain}