Deploy Prometheus services in mcp11-k8S-calico

This change also installs Telegraf and bumps classes/system because it
is needed for Prometheus.

Change-Id: I16e08a41a1b3a13a2132572b35a8abe5e85ed693
diff --git a/classes/cluster/virtual-mcp11-k8s-calico/infra/config.yml b/classes/cluster/virtual-mcp11-k8s-calico/infra/config.yml
index 2b295d1..4bb98f5 100644
--- a/classes/cluster/virtual-mcp11-k8s-calico/infra/config.yml
+++ b/classes/cluster/virtual-mcp11-k8s-calico/infra/config.yml
@@ -1,5 +1,4 @@
 classes:
-- system.linux.system.repo.mcp.salt
 - system.linux.system.repo.ubuntu
 - system.openssh.client.lab
 - system.salt.master.pkg
@@ -19,7 +18,6 @@
     linux_system_codename: xenial
     salt_api_password_hash: "$6$WV0P1shnoDh2gI/Z$22/Bcd7ffMv0jDlFpT63cAU4PiXHz9pjXwngToKwqAsgoeK4HNR3PiKaushjxp3JsQ8hNoJmAC6TxzVqfV8WH/"
     salt_master_host: ${_param:infra_config_deploy_address}
-    apt_mk_version: nightly
   reclass:
     storage:
       node:
@@ -45,7 +43,7 @@
           name: ${_param:kubernetes_proxy_node01_hostname}
           domain: ${_param:cluster_domain}
           classes:
-          - cluster.${_param:cluster_name}.infra
+          - cluster.${_param:cluster_name}.monitoring.proxy
           params:
             salt_master_host: ${_param:infra_config_deploy_address}
             linux_system_codename: xenial
@@ -55,25 +53,31 @@
           domain: ${_param:cluster_domain}
           classes:
           - cluster.${_param:cluster_name}.swarm.master
+          - cluster.${_param:cluster_name}.monitoring.server
           params:
             salt_master_host: ${_param:infra_config_deploy_address}
             linux_system_codename: xenial
             single_address: ${_param:docker_swarm_node01_address}
+            keepalived_vip_priority: 100
         docker_swarm_node02:
           name: ${_param:docker_swarm_node02_hostname}
           domain: ${_param:cluster_domain}
           classes:
           - cluster.${_param:cluster_name}.swarm.slave
+          - cluster.${_param:cluster_name}.monitoring.server
           params:
             salt_master_host: ${_param:infra_config_deploy_address}
             linux_system_codename: xenial
             single_address: ${_param:docker_swarm_node02_address}
+            keepalived_vip_priority: 101
         docker_swarm_node03:
           name: ${_param:docker_swarm_node03_hostname}
           domain: ${_param:cluster_domain}
           classes:
           - cluster.${_param:cluster_name}.swarm.slave
+          - cluster.${_param:cluster_name}.monitoring.server
           params:
             salt_master_host: ${_param:infra_config_deploy_address}
             linux_system_codename: xenial
             single_address: ${_param:docker_swarm_node03_address}
+            keepalived_vip_priority: 102
diff --git a/classes/cluster/virtual-mcp11-k8s-calico/infra/init.yml b/classes/cluster/virtual-mcp11-k8s-calico/infra/init.yml
index 39404c0..adbc05c 100644
--- a/classes/cluster/virtual-mcp11-k8s-calico/infra/init.yml
+++ b/classes/cluster/virtual-mcp11-k8s-calico/infra/init.yml
@@ -1,11 +1,16 @@
 classes:
 - system.linux.system.single
+- system.linux.system.repo.mcp.extra
+- system.linux.system.repo.mcp.salt
+- system.linux.system.repo.ubuntu
 - system.openssh.server.team.lab
 - system.openssh.server.team.stacklight
 - system.openssh.server.team.tcpcloud
 - system.openssh.server.team.mcp_qa
 - system.rsyslog.client.single
+- system.telegraf.agent
 - cluster.virtual-mcp11-k8s-calico.kubernetes
+- cluster.virtual-mcp11-k8s-calico.monitoring
 - cluster.virtual-mcp11-k8s-calico.swarm
 - cluster.overwrite
 parameters:
@@ -17,6 +22,7 @@
 
     cluster_domain: virtual-mcp11-k8s-calico.local
     cluster_name: virtual-mcp11-k8s-calico
+    apt_mk_version: nightly
   linux:
     network:
       host:
@@ -35,3 +41,17 @@
     system:
       name: ${_param:infra_config_hostname}
       domain: ${_param:cluster_domain}
+  telegraf:
+    agent:
+      enabled: true
+      interval: 15
+      round_interval: false
+      metric_batch_size: 1000
+      metric_buffer_limit: 10000
+      collection_jitter: 2
+      output:
+        prometheus_client:
+          bind:
+            address: 0.0.0.0
+            port: 9126
+          engine: prometheus
diff --git a/classes/cluster/virtual-mcp11-k8s-calico/kubernetes/control.yml b/classes/cluster/virtual-mcp11-k8s-calico/kubernetes/control.yml
index 5f3298d..f224099 100644
--- a/classes/cluster/virtual-mcp11-k8s-calico/kubernetes/control.yml
+++ b/classes/cluster/virtual-mcp11-k8s-calico/kubernetes/control.yml
@@ -4,6 +4,8 @@
 - system.linux.system.repo.docker
 - system.salt.minion.cert.etcd_server
 - system.kubernetes.master.cluster
+- system.glusterfs.server.cluster
+- system.glusterfs.server.volume.prometheus
 - cluster.virtual-mcp11-k8s-calico.kubernetes.compute
 - cluster.virtual-mcp11-k8s-calico.infra
 parameters:
diff --git a/classes/cluster/virtual-mcp11-k8s-calico/kubernetes/init.yml b/classes/cluster/virtual-mcp11-k8s-calico/kubernetes/init.yml
index d1d437d..d494439 100644
--- a/classes/cluster/virtual-mcp11-k8s-calico/kubernetes/init.yml
+++ b/classes/cluster/virtual-mcp11-k8s-calico/kubernetes/init.yml
@@ -49,6 +49,9 @@
     calico_private_network: 192.168.0.0
     calico_private_netmask: 16
 
+    # glusterfs
+    glusterfs_service_host: ${_param:kubernetes_control_address}
+
   linux:
     network:
       resolv:
diff --git a/classes/cluster/virtual-mcp11-k8s-calico/monitoring/init.yml b/classes/cluster/virtual-mcp11-k8s-calico/monitoring/init.yml
new file mode 100644
index 0000000..d054aa0
--- /dev/null
+++ b/classes/cluster/virtual-mcp11-k8s-calico/monitoring/init.yml
@@ -0,0 +1,3 @@
+parameters:
+  _param:
+    prometheus_control_address: ${_param:docker_swarm_address}
diff --git a/classes/cluster/virtual-mcp11-k8s-calico/monitoring/proxy.yml b/classes/cluster/virtual-mcp11-k8s-calico/monitoring/proxy.yml
new file mode 100644
index 0000000..f09e157
--- /dev/null
+++ b/classes/cluster/virtual-mcp11-k8s-calico/monitoring/proxy.yml
@@ -0,0 +1,8 @@
+classes:
+- system.nginx.server.single
+- system.nginx.server.proxy.monitoring.prometheus_server
+- system.nginx.server.proxy.monitoring.prometheus_alertmanager
+- cluster.virtual-mcp11-k8s-calico.infra
+parameters:
+  _param:
+    cluster_public_host: ${_param:prometheus_control_address}
diff --git a/classes/cluster/virtual-mcp11-k8s-calico/monitoring/server.yml b/classes/cluster/virtual-mcp11-k8s-calico/monitoring/server.yml
new file mode 100644
index 0000000..d93890c
--- /dev/null
+++ b/classes/cluster/virtual-mcp11-k8s-calico/monitoring/server.yml
@@ -0,0 +1,19 @@
+classes:
+- system.glusterfs.client.cluster
+- system.glusterfs.client.volume.prometheus
+- system.salt.minion.cert.prometheus_server
+- system.keepalived.cluster.instance.prometheus_server_vip
+- system.prometheus.server.target.etcd
+- system.prometheus.server.target.kubernetes
+- system.prometheus.server.target.dns
+- system.docker.swarm.stack.monitoring
+- cluster.virtual-mcp11-k8s-calico.infra
+parameters:
+  _param:
+    cluster_vip_address: ${_param:docker_swarm_address}
+    docker_image_alertmanager: alertmanager:latest
+    docker_image_pushgateway: pushgateway:latest
+    docker_image_prometheus: prometheus:latest
+    keepalived_prometheus_vip_address: ${_param:cluster_vip_address}
+    keepalived_prometheus_vip_password: password
+    keepalived_prometheus_vip_interface: ens4
diff --git a/classes/cluster/virtual-mcp11-k8s-calico/swarm/control.yml b/classes/cluster/virtual-mcp11-k8s-calico/swarm/control.yml
deleted file mode 100644
index 5f91f9e..0000000
--- a/classes/cluster/virtual-mcp11-k8s-calico/swarm/control.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-classes:
-- system.docker.host
-- cluster.virtual-mcp11-k8s-calico.infra
-parameters:
-  _param:
-    cluster_vip_address: ${_param:docker_swarm_address}
-    cluster_public_host: ${_param:docker_swarm_hostname}
diff --git a/classes/cluster/virtual-mcp11-k8s-calico/swarm/master.yml b/classes/cluster/virtual-mcp11-k8s-calico/swarm/master.yml
index 8d53081..b2d33a1 100644
--- a/classes/cluster/virtual-mcp11-k8s-calico/swarm/master.yml
+++ b/classes/cluster/virtual-mcp11-k8s-calico/swarm/master.yml
@@ -1,8 +1,11 @@
 classes:
 - system.docker.client
+- system.docker.host
 - system.docker.swarm.master
-- cluster.virtual-mcp11-k8s-calico.swarm.control
+- cluster.virtual-mcp11-k8s-calico.infra
 parameters:
+  _param:
+    cluster_public_host: ${_param:docker_swarm_hostname}
   docker:
     client:
       enabled: true
diff --git a/classes/cluster/virtual-mcp11-k8s-calico/swarm/slave.yml b/classes/cluster/virtual-mcp11-k8s-calico/swarm/slave.yml
index 1b1a8d2..810da3d 100644
--- a/classes/cluster/virtual-mcp11-k8s-calico/swarm/slave.yml
+++ b/classes/cluster/virtual-mcp11-k8s-calico/swarm/slave.yml
@@ -1,7 +1,10 @@
 classes:
+- system.docker.host
 - system.docker.swarm.manager
-- cluster.virtual-mcp11-k8s-calico.swarm.control
+- cluster.virtual-mcp11-k8s-calico.infra
 parameters:
+  _param:
+    cluster_public_host: ${_param:docker_swarm_hostname}
   docker:
     swarm:
       master: